Skip to content

Commit 24fef11

Browse files
feat: Add API skill with OpenAPI/Restish integration
- Add /api skill for zero-code API integration via OpenAPI specs - Implement API auto-discovery from URLs (GCP, Railway, GitHub, Stripe, etc.) - Create CLI commands: api add, list, describe, exec, discover - Support REST, GraphQL, and Google Discovery format APIs - Update shell keybindings (Shift+Tab → request, Tab → accept) - Add comprehensive spec document for Specish API patterns Supported services: - REST: GitHub, Stripe, Twilio, Slack, Discord, OpenAI, Anthropic, etc. - GraphQL: Railway, Linear - Google Discovery: GCP Compute, Storage, Cloud Run, BigQuery, AI Platform Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d2d52f1 commit 24fef11

18 files changed

Lines changed: 3758 additions & 29 deletions

File tree

.claude/commands/api.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# /api - OpenAPI-Based API Access
2+
3+
Execute API calls using OpenAPI specifications via Restish.
4+
5+
## Usage
6+
7+
```bash
8+
# Register an API
9+
stackmemory api add <name> <base-url> [--spec <openapi-url>] [--auth-type api-key]
10+
11+
# List registered APIs
12+
stackmemory api list
13+
14+
# Execute API call
15+
stackmemory api exec <name> <path> [--param value...]
16+
17+
# Configure authentication
18+
stackmemory api auth <name> --token <token> --env-var <VAR_NAME>
19+
```
20+
21+
## Examples
22+
23+
### GitHub API
24+
25+
```bash
26+
# Register
27+
stackmemory api add github https://api.github.com
28+
29+
# Auth (optional)
30+
stackmemory api auth github --token "$GITHUB_TOKEN" --env-var GITHUB_TOKEN
31+
32+
# Execute
33+
stackmemory api exec github /repos/anthropics/anthropic-sdk-python
34+
stackmemory api exec github /users/octocat
35+
stackmemory api exec github /search/repositories --q "language:typescript stars:>1000"
36+
```
37+
38+
### Linear API
39+
40+
```bash
41+
# Register
42+
stackmemory api add linear https://api.linear.app --auth-type api-key
43+
44+
# Auth
45+
stackmemory api auth linear --token "$LINEAR_API_KEY" --env-var LINEAR_API_KEY
46+
47+
# Execute (GraphQL via POST)
48+
stackmemory api exec linear /graphql
49+
```
50+
51+
## How It Works
52+
53+
1. **Registration**: Stores API config in `~/.stackmemory/api-registry.json` and configures Restish
54+
2. **Auth**: Injects tokens from environment variables into request headers
55+
3. **Execution**: Uses Restish CLI for HTTP requests with automatic JSON parsing
56+
4. **Output**: Returns JSON response data
57+
58+
## Requirements
59+
60+
- Restish CLI: `brew install restish`
61+
62+
## Integration
63+
64+
This skill integrates with StackMemory's context system to:
65+
- Track API calls in session history
66+
- Enable context-aware suggestions for common operations
67+
- Store API responses for later retrieval
68+
69+
## See Also
70+
71+
- [Restish Documentation](https://rest.sh/)
72+
- [OpenAPI Specification](https://swagger.io/specification/)
Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,29 @@
11
{
22
"analysis": {
3-
"filesCount": 3,
4-
"testsPass": 3,
5-
"testsFail": 2,
6-
"lastChange": "f3e1fef fix: Update CLI version to match package.json 0.4.2"
3+
"filesCount": 7,
4+
"testsPass": 10,
5+
"testsFail": 1,
6+
"lastChange": "Iteration 0 changes"
77
},
88
"plan": {
9-
"summary": "Iteration work based on: ",
9+
"summary": "Work for iteration 0",
1010
"steps": [
11-
"Fix issues",
12-
"Add features",
13-
"Update tests"
11+
"Task 0-1",
12+
"Task 0-2",
13+
"Task 0-3"
1414
],
1515
"priority": "high"
1616
},
1717
"changes": [
1818
{
19-
"step": "Fix issues",
20-
"timestamp": 1768939666491,
21-
"result": "simulated"
22-
},
23-
{
24-
"step": "Add features",
25-
"timestamp": 1768939666491,
26-
"result": "simulated"
27-
},
28-
{
29-
"step": "Update tests",
30-
"timestamp": 1768939666491,
31-
"result": "simulated"
19+
"step": "Task 0-1",
20+
"timestamp": 1768986932624,
21+
"result": "completed"
3222
}
3323
],
3424
"validation": {
3525
"testsPass": true,
3626
"lintClean": true,
37-
"errors": [
38-
"Some tests failed"
39-
]
27+
"errors": []
4028
}
4129
}

.ralph/iteration.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0
1+
10

.ralph/state.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"startTime": 1768987694285,
3-
"task": "Implement missing SwarmCoordinator methods (getSwarmStatus, getAllActiveSwarms, stopSwarm, forceStop",
4-
"status": "initialized"
2+
"task": "Test multiple iterations beyond 5",
3+
"iteration": 10,
4+
"status": "running",
5+
"startTime": 1768986932623
56
}

0 commit comments

Comments
 (0)