@octp/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +296 -0
- package/package.json +1 -2
package/README.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# Octopus CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for [Octopus](https://octopus-review.ai) — AI-powered PR review and codebase intelligence platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @octp/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Authentication
|
|
12
|
+
|
|
13
|
+
### Browser Login (Recommended)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
octopus login
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Opens your browser to authorize the CLI with your Octopus account. Select an organization, approve access, and you're ready to go.
|
|
20
|
+
|
|
21
|
+
### Token Login
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
octopus login --token oct_your_api_token
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use an existing API token (generated from the Octopus dashboard) to authenticate directly.
|
|
28
|
+
|
|
29
|
+
### Custom API URL
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
octopus login --api-url https://your-instance.example.com
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Multiple Profiles
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
octopus login --profile work
|
|
39
|
+
octopus login --profile personal
|
|
40
|
+
octopus config set activeProfile work
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Environment Variables
|
|
44
|
+
|
|
45
|
+
| Variable | Description |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `OCTOPUS_API_KEY` | API token (overrides saved config) |
|
|
48
|
+
| `OCTOPUS_API_URL` | API base URL (overrides saved config) |
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
### `octopus whoami`
|
|
53
|
+
|
|
54
|
+
Display your current user and organization info.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
$ octopus whoami
|
|
58
|
+
|
|
59
|
+
Account
|
|
60
|
+
Name: John Doe
|
|
61
|
+
Email: john@example.com
|
|
62
|
+
|
|
63
|
+
Organization
|
|
64
|
+
Name: Acme Corp
|
|
65
|
+
Slug: acme-corp
|
|
66
|
+
Members: 12
|
|
67
|
+
Repos: 34
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `octopus repo list`
|
|
71
|
+
|
|
72
|
+
List all repositories connected to your organization.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
$ octopus repo list
|
|
76
|
+
|
|
77
|
+
Repository Provider Index Analysis PRs Last Indexed
|
|
78
|
+
acme/backend github indexed done 42 2 hours ago
|
|
79
|
+
acme/frontend github indexed done 28 1 day ago
|
|
80
|
+
acme/mobile-app github pending pending 0 —
|
|
81
|
+
|
|
82
|
+
3 repositories total
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `octopus repo status [repo]`
|
|
86
|
+
|
|
87
|
+
Show detailed status for a repository. Auto-detects the repo from your current git remote, or specify it explicitly.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Auto-detect from current directory
|
|
91
|
+
octopus repo status
|
|
92
|
+
|
|
93
|
+
# Specify explicitly
|
|
94
|
+
octopus repo status acme/backend
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
$ octopus repo status
|
|
99
|
+
|
|
100
|
+
acme/backend
|
|
101
|
+
Provider: github
|
|
102
|
+
Default Branch: main
|
|
103
|
+
Auto Review: enabled
|
|
104
|
+
|
|
105
|
+
Indexing
|
|
106
|
+
Status: indexed
|
|
107
|
+
Last Index: 2 hours ago
|
|
108
|
+
Files: 847/847
|
|
109
|
+
Chunks: 3,241
|
|
110
|
+
Vectors: 3,241
|
|
111
|
+
Duration: 2m 14s
|
|
112
|
+
|
|
113
|
+
Analysis
|
|
114
|
+
Status: done
|
|
115
|
+
Last Analyzed: 1 day ago
|
|
116
|
+
Purpose: Backend API service for the Acme platform
|
|
117
|
+
Summary: Node.js REST API with PostgreSQL...
|
|
118
|
+
|
|
119
|
+
Stats
|
|
120
|
+
Pull Requests: 42
|
|
121
|
+
Contributors: 8
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `octopus repo index [repo]`
|
|
125
|
+
|
|
126
|
+
Trigger code indexing for a repository. The CLI polls until indexing completes.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
octopus repo index
|
|
130
|
+
octopus repo index acme/backend
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `octopus repo analyze [repo]`
|
|
134
|
+
|
|
135
|
+
Run AI analysis on a repository to generate purpose summaries and codebase understanding.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
octopus repo analyze
|
|
139
|
+
octopus repo analyze acme/backend
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### `octopus repo chat [repo]`
|
|
143
|
+
|
|
144
|
+
Start an interactive chat session about a repository. Ask questions about the codebase and get AI-powered answers with full context.
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
$ octopus repo chat
|
|
148
|
+
|
|
149
|
+
Chatting about acme/backend. Type 'exit' or Ctrl+C to quit.
|
|
150
|
+
|
|
151
|
+
you> How does authentication work in this project?
|
|
152
|
+
octopus> The project uses JWT-based authentication with...
|
|
153
|
+
|
|
154
|
+
you> Where are the database migrations?
|
|
155
|
+
octopus> Database migrations are located in...
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### `octopus pr review <pr>`
|
|
159
|
+
|
|
160
|
+
Trigger an AI review on a pull request. Accepts a PR number or full URL.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# By PR number (uses current repo)
|
|
164
|
+
octopus pr review 123
|
|
165
|
+
|
|
166
|
+
# By GitHub URL
|
|
167
|
+
octopus pr review https://github.com/acme/backend/pull/123
|
|
168
|
+
|
|
169
|
+
# By Bitbucket URL
|
|
170
|
+
octopus pr review https://bitbucket.org/acme/backend/pull-requests/123
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The review results are posted as comments directly on the PR.
|
|
174
|
+
|
|
175
|
+
### `octopus knowledge list`
|
|
176
|
+
|
|
177
|
+
List all knowledge base documents in your organization.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
$ octopus knowledge list
|
|
181
|
+
|
|
182
|
+
ID Title Type Status Chunks Created
|
|
183
|
+
cm3x... API Guidelines file indexed 12 3 days ago
|
|
184
|
+
cm4a... Security Policy file indexed 8 1 week ago
|
|
185
|
+
|
|
186
|
+
2 documents total
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `octopus knowledge add <file>`
|
|
190
|
+
|
|
191
|
+
Upload a file to your organization's knowledge base. These documents provide additional context for AI reviews.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
octopus knowledge add docs/api-guidelines.md
|
|
195
|
+
octopus knowledge add --title "Security Policy" security.pdf
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### `octopus knowledge remove <id>`
|
|
199
|
+
|
|
200
|
+
Remove a document from the knowledge base.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
octopus knowledge remove cm3x1234
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### `octopus usage`
|
|
207
|
+
|
|
208
|
+
Show your organization's monthly usage, spend, and credit balance.
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
$ octopus usage
|
|
212
|
+
|
|
213
|
+
Monthly Usage
|
|
214
|
+
Period: Mar 1, 2026 — now
|
|
215
|
+
Total Spend: $12.34
|
|
216
|
+
Spend Limit: $100.00
|
|
217
|
+
Credit Balance: $87.66 (+ $10.00 free)
|
|
218
|
+
|
|
219
|
+
Breakdown
|
|
220
|
+
Model Operation Calls Input Output Cost
|
|
221
|
+
claude-sonnet-4-6 review 45 1,234,567 234,567 $8.50
|
|
222
|
+
text-embedding-3-l embedding 120 2,345,678 0 $2.34
|
|
223
|
+
claude-haiku-4-5 chat 30 345,678 45,678 $1.50
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### `octopus config list`
|
|
227
|
+
|
|
228
|
+
List all saved profiles.
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
$ octopus config list
|
|
232
|
+
|
|
233
|
+
Profile Org API URL Token
|
|
234
|
+
* default acme-corp https://octopus-review.ai oct_a1b2...
|
|
235
|
+
personal my-org https://octopus-review.ai oct_c3d4...
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### `octopus config set <key> <value>`
|
|
239
|
+
|
|
240
|
+
Update a configuration value.
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
octopus config set activeProfile personal
|
|
244
|
+
octopus config set apiUrl https://your-instance.example.com
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### `octopus config get <key>`
|
|
248
|
+
|
|
249
|
+
Read a configuration value. Available keys: `activeProfile`, `apiUrl`, `orgSlug`, `orgId`.
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
octopus config get activeProfile
|
|
253
|
+
octopus config get apiUrl
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### `octopus logout`
|
|
257
|
+
|
|
258
|
+
Remove saved credentials for a profile.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
octopus logout
|
|
262
|
+
octopus logout --profile work
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Configuration
|
|
266
|
+
|
|
267
|
+
Credentials and settings are stored in `~/.config/octopus/config.json` with `0600` permissions (readable only by you).
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"activeProfile": "default",
|
|
272
|
+
"profiles": {
|
|
273
|
+
"default": {
|
|
274
|
+
"apiUrl": "https://octopus-review.ai",
|
|
275
|
+
"token": "oct_...",
|
|
276
|
+
"orgSlug": "acme-corp",
|
|
277
|
+
"orgId": "cm3x..."
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Repository Auto-Detection
|
|
284
|
+
|
|
285
|
+
Commands that accept a `[repo]` argument will automatically detect the repository from your current directory's git remote. This means you can run most commands without specifying a repo:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
cd ~/projects/my-app
|
|
289
|
+
octopus repo status # auto-detects from git remote
|
|
290
|
+
octopus repo index # auto-detects from git remote
|
|
291
|
+
octopus pr review 42 # auto-detects from git remote
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## License
|
|
295
|
+
|
|
296
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octp/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "CLI tool for Octopus — AI-powered PR review and codebase intelligence",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"ora": "^8.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@octopus/tsconfig": "workspace:*",
|
|
26
25
|
"@types/node": "^20",
|
|
27
26
|
"typescript": "^5"
|
|
28
27
|
}
|