Skip to content

Commit 2a7e9f0

Browse files
committed
CLI installation and updating
1 parent 20b8ba9 commit 2a7e9f0

File tree

13 files changed

+89
-17
lines changed

13 files changed

+89
-17
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"name": "asta",
1212
"source": "./",
1313
"description": "Paper search, citations, literature reports, and Semantic Scholar API tools",
14-
"version": "0.8.0",
14+
"version": "0.8.1",
1515
"author": {
1616
"name": "AI2 Asta Team"
1717
},

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asta",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"description": "Asta science tools for Claude Code - paper search, citations, and more",
55
"author": {
66
"name": "AI2 Asta Team"

DEVELOPER.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ make version
420420
```bash
421421
make set-version VERSION=x.y.z
422422
```
423-
- Updates all four version locations atomically
423+
- Updates all locations atomically
424424
- Fails with error if VERSION parameter is not provided
425425
- Provides suggested commit command after success
426426

@@ -444,7 +444,6 @@ Checking version consistency...
444444
Error: Version mismatch detected:
445445
src/asta/__init__.py: 0.3.0
446446
pyproject.toml: 0.2.0
447-
.claude-plugin/plugin.json: 0.2.0
448447
.claude-plugin/marketplace.json: 0.2.0
449448

450449
Run 'make set-version VERSION=x.y.z' to sync versions

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ set-version:
9797
uv run python -c "import json; f = open('.claude-plugin/plugin.json', 'r'); data = json.load(f); f.close(); data['version'] = '$(VERSION)'; f = open('.claude-plugin/plugin.json', 'w'); json.dump(data, f, indent=2); f.write('\n'); f.close()"; \
9898
echo "Updating .claude-plugin/marketplace.json..."; \
9999
uv run python -c "import json; f = open('.claude-plugin/marketplace.json', 'r'); data = json.load(f); f.close(); data['plugins'][0]['version'] = '$(VERSION)'; f = open('.claude-plugin/marketplace.json', 'w'); json.dump(data, f, indent=2); f.write('\n'); f.close()"; \
100+
echo "Updating skill installation sections..."; \
101+
find skills -name "SKILL.md" -exec sed -i.bak "s/PLUGIN_VERSION=[0-9]*\.[0-9]*\.[0-9]*/PLUGIN_VERSION=$(VERSION)/g" {} \; && find skills -name "*.bak" -delete; \
102+
echo "Updating sync-version hook..."; \
103+
sed -i.bak "s/PLUGIN_VERSION=[0-9]*\.[0-9]*\.[0-9]*/PLUGIN_VERSION=$(VERSION)/g" hooks/sync-cli-version.sh && rm hooks/sync-cli-version.sh.bak; \
100104
echo "Version updated to $(VERSION) in all files"; \
101105
echo "Review changes and commit with: git add -A && git commit -m 'chore: bump version to $(VERSION)'"
102106

hooks/hooks.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
{
88
"type": "command",
99
"command": "mkdir -p ~/.asta/literature"
10+
},
11+
{
12+
"type": "command",
13+
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/sync-cli-version.sh"
1014
}
1115
]
1216
}

hooks/sync-cli-version.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# Check if asta CLI version matches the plugin version and auto-install/update if needed
3+
4+
PLUGIN_VERSION=0.8.1
5+
INSTALL_URL="git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION"
6+
7+
# Check if asta is installed
8+
if ! command -v asta &> /dev/null; then
9+
echo "📦 Installing Asta CLI version $PLUGIN_VERSION..."
10+
if uv tool install "$INSTALL_URL"; then
11+
echo "✅ Asta CLI $PLUGIN_VERSION installed successfully"
12+
else
13+
echo "❌ Failed to install Asta CLI"
14+
exit 1
15+
fi
16+
exit 0
17+
fi
18+
19+
# Get installed CLI version
20+
CLI_VERSION=$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
21+
22+
# Compare versions
23+
if [ "$CLI_VERSION" != "$PLUGIN_VERSION" ]; then
24+
echo "🔄 Updating Asta CLI from $CLI_VERSION to $PLUGIN_VERSION..."
25+
if uv tool install --force "$INSTALL_URL"; then
26+
echo "✅ Asta CLI updated to $PLUGIN_VERSION successfully"
27+
else
28+
echo "❌ Failed to update Asta CLI"
29+
exit 1
30+
fi
31+
fi

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "asta"
7-
version = "0.8.0"
7+
version = "0.8.1"
88
description = "Asta CLI for scientific literature review"
99
readme = "README.md"
1010
requires-python = ">=3.11"

skills/experiment/SKILL.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ allowed-tools:
77
- Read(.asta/experiment/*)
88
- TaskOutput
99
---
10-
1110
# Run Experiments
1211

1312
Run a computational experiment. Given a research question that can be answered via software,
@@ -17,11 +16,18 @@ This skill can also be used to analyze experimental data and generate a research
1716

1817
## Installation
1918

20-
If `asta` command is not available install it using `uv tool install git+ssh://git@github.com/allenai/asta-plugins.git`
19+
This skill requires the `asta` CLI:
20+
21+
```bash
22+
# Install/reinstall at the correct version
23+
PLUGIN_VERSION=0.8.1
24+
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
25+
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
26+
fi
27+
```
2128

2229
**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)
2330

24-
Verify installation with `asta experiment --help`
2531

2632
## Workflow
2733

skills/find-literature/SKILL.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,25 @@ allowed-tools:
1010

1111
# Find Literature
1212

13-
Search academic literature for papers relevant to a query. The search will return a ranked list of papers with relevance scores, summaries, and supporting snippets.
13+
Search academic literature for papers relevant to a query. The search will return a ranked list of papers with relevance scores, summaries, and supporting snippets.
1414

1515
This is an advanced search, so the query can be long and complex. You may ask the user
1616
questions to clarify the topic and refine the query before running the search.
1717

1818
## Installation
1919

20-
If `asta` command is not available install it using `uv tool install git+ssh://git@github.com/allenai/asta-plugins.git`
20+
This skill requires the `asta` CLI:
21+
22+
```bash
23+
# Install/reinstall at the correct version
24+
PLUGIN_VERSION=0.8.1
25+
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
26+
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
27+
fi
28+
```
2129

2230
**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)
2331

24-
Verify installation with `asta literature --help`
2532

2633
## Tools Available
2734

skills/pdf-extraction/SKILL.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ allowed-tools:
1515

1616
Extract high-quality text from PDFs using the [olmOCR](https://github.com/allenai/olmOCR) tool. This skill uses the olmocr CLI for cloud-based OCR processing.
1717

18+
## Installation
19+
20+
This skill requires the `asta` CLI:
21+
22+
```bash
23+
# Install/reinstall at the correct version
24+
PLUGIN_VERSION=0.8.1
25+
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
26+
uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
27+
fi
28+
```
29+
30+
**Prerequisites:** Python 3.11+ and [uv package manager](https://docs.astral.sh/uv/)
31+
32+
1833
## Quick Start
1934

2035
### Extract Text from PDF

0 commit comments

Comments
 (0)