@codesummary/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 +119 -166
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,280 +1,233 @@
|
|
|
1
1
|
# CodeSummary CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
upload a local source snapshot, and start knowledge updates from the repo
|
|
6
|
-
directory.
|
|
3
|
+
Submit a local codebase to CodeSummary, generate or update hosted knowledge,
|
|
4
|
+
and optionally run documentation generation locally with your own provider.
|
|
7
5
|
|
|
8
6
|
## Install
|
|
9
7
|
|
|
10
|
-
Before npm publication, install from the private GitHub repo:
|
|
11
|
-
|
|
12
8
|
```bash
|
|
13
|
-
npm install -g
|
|
9
|
+
npm install -g @codesummary/cli
|
|
14
10
|
```
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
Verify the install:
|
|
17
13
|
|
|
18
14
|
```bash
|
|
19
|
-
|
|
15
|
+
codesummary --version
|
|
20
16
|
```
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
Run these commands from the repository you want CodeSummary to understand:
|
|
23
21
|
|
|
24
22
|
```bash
|
|
25
|
-
codesummary login
|
|
23
|
+
codesummary login
|
|
26
24
|
codesummary
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
The interactive `codesummary` command detects the current workspace, signs in
|
|
28
|
+
with your CodeSummary account, creates or links a private docs site, uploads the
|
|
29
|
+
source snapshot, and starts the right knowledge job.
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
After the first run, use the same command to update knowledge:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
codesummary
|
|
35
|
+
```
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
## Common Commands
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
codesummary # interactive hosted workflow
|
|
41
|
+
codesummary login # sign in with CodeSummary OAuth
|
|
42
|
+
codesummary whoami # show current account/workspace state
|
|
43
|
+
codesummary status # show latest job status
|
|
44
|
+
codesummary status --wait # follow latest job until it finishes
|
|
45
|
+
codesummary diff # compare local files to last submitted manifest
|
|
46
|
+
codesummary manifest # write .codesummary/manifest.json
|
|
47
|
+
codesummary logout # remove local CLI auth for this workspace
|
|
40
48
|
```
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
and verifies that the installed `codesummary` binary starts correctly inside a
|
|
44
|
-
repo workspace.
|
|
50
|
+
## Initialize A Workspace
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
Use `new` when you want to create or prepare a workspace before generating
|
|
53
|
+
knowledge:
|
|
47
54
|
|
|
48
55
|
```bash
|
|
49
|
-
codesummary
|
|
50
|
-
codesummary new ./my-service --api-url https://dashboard.codesummary.io
|
|
51
|
-
codesummary login --api-url https://dashboard.codesummary.io
|
|
52
|
-
codesummary config set apiUrl https://dashboard.codesummary.io
|
|
53
|
-
codesummary config get apiUrl
|
|
54
|
-
codesummary config clear apiUrl
|
|
55
|
-
codesummary link --site-token <csp_token> --api-url https://dashboard.codesummary.io --name my-repo
|
|
56
|
-
codesummary manifest
|
|
57
|
-
codesummary diff
|
|
58
|
-
codesummary export --output ./codesummary-export
|
|
59
|
-
codesummary export --output s3://my-bucket/path --include-archive
|
|
60
|
-
codesummary generate --provider codex --output ./docs
|
|
61
|
-
codesummary generate --provider openai --api-key-env OPENAI_API_KEY --output ./docs
|
|
62
|
-
codesummary configure --provider codex --output ./docs
|
|
63
|
-
codesummary generate
|
|
64
|
-
codesummary submit --depth standard
|
|
65
|
-
codesummary status
|
|
66
|
-
codesummary submit --depth standard --wait
|
|
67
|
-
codesummary version
|
|
68
|
-
codesummary update
|
|
56
|
+
codesummary new ./my-service
|
|
69
57
|
```
|
|
70
58
|
|
|
71
|
-
|
|
72
|
-
current directory, OAuth state, linked site, last submitted manifest, and local
|
|
73
|
-
diff, then offers the right action:
|
|
59
|
+
For an existing repo:
|
|
74
60
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
```bash
|
|
62
|
+
codesummary new --name my-service --force
|
|
63
|
+
```
|
|
78
64
|
|
|
79
|
-
`new`
|
|
80
|
-
|
|
81
|
-
existing files. If you point it at a non-empty directory, pass `--force` to
|
|
82
|
-
confirm you want to initialize that directory in place.
|
|
65
|
+
`new` creates `.codesummary/config.json` and stores local defaults. It does not
|
|
66
|
+
delete source files, call CodeSummary hosted services, or start generation.
|
|
83
67
|
|
|
84
|
-
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
Workspace configuration lives in `.codesummary/config.json`.
|
|
85
71
|
|
|
86
72
|
```bash
|
|
87
73
|
codesummary config list
|
|
74
|
+
codesummary config get apiUrl
|
|
88
75
|
codesummary config set apiUrl https://dashboard.codesummary.io
|
|
89
76
|
codesummary config set sourceName my-service
|
|
90
77
|
codesummary config set depth standard
|
|
91
|
-
codesummary config set localGeneration.provider codex
|
|
92
|
-
codesummary config get sourceName
|
|
93
78
|
codesummary config clear depth
|
|
94
79
|
```
|
|
95
80
|
|
|
96
|
-
Supported keys
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`
|
|
101
|
-
|
|
102
|
-
site.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
The CLI stores the last submitted job id in `.codesummary/config.json`, so
|
|
114
|
-
`codesummary status` can check it without passing `--job-id`. Status responses
|
|
115
|
-
include both the repo job and the latest linked site job when a site update is
|
|
116
|
-
running.
|
|
117
|
-
|
|
118
|
-
After a successful submit, the CLI stores
|
|
119
|
-
`.codesummary/last-submitted-manifest.json`. `codesummary diff` compares the
|
|
120
|
-
current workspace against that baseline and reports added, changed, and removed
|
|
121
|
-
files without uploading anything. Use `--against <manifest.json>` to compare
|
|
122
|
-
against a specific baseline.
|
|
123
|
-
|
|
124
|
-
`export` creates a local or S3 bundle without calling CodeSummary hosted
|
|
125
|
-
infrastructure. By default it exports only manifest metadata and does not include
|
|
126
|
-
source contents. Pass `--include-archive` only when writing to infrastructure you
|
|
127
|
-
control.
|
|
128
|
-
|
|
129
|
-
## Auth
|
|
130
|
-
|
|
131
|
-
Use OAuth for the normal developer workflow:
|
|
81
|
+
Supported keys:
|
|
82
|
+
|
|
83
|
+
- `apiUrl`
|
|
84
|
+
- `sourceName`
|
|
85
|
+
- `depth`
|
|
86
|
+
- `site.id`
|
|
87
|
+
- `site.slug`
|
|
88
|
+
- `site.name`
|
|
89
|
+
- `localGeneration.provider`
|
|
90
|
+
- `localGeneration.output`
|
|
91
|
+
- `localGeneration.model`
|
|
92
|
+
- `localGeneration.apiKeyEnv`
|
|
93
|
+
|
|
94
|
+
## Hosted Knowledge Updates
|
|
95
|
+
|
|
96
|
+
Use the hosted workflow when you want CodeSummary to generate or update the
|
|
97
|
+
private draft for a docs site without committing generated files to your repo:
|
|
132
98
|
|
|
133
99
|
```bash
|
|
134
|
-
codesummary login
|
|
100
|
+
codesummary login
|
|
135
101
|
codesummary
|
|
136
102
|
```
|
|
137
103
|
|
|
138
|
-
|
|
139
|
-
|
|
104
|
+
The CLI uploads a filtered source snapshot and a manifest. CodeSummary uses the
|
|
105
|
+
snapshot to run the knowledge job, then tracks future changes with the manifest.
|
|
140
106
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
107
|
+
The archive excludes common dependency, build, cache, and secret files:
|
|
108
|
+
|
|
109
|
+
- `.git`
|
|
110
|
+
- `node_modules`
|
|
111
|
+
- `.next`
|
|
112
|
+
- `dist`
|
|
113
|
+
- `build`
|
|
114
|
+
- `coverage`
|
|
115
|
+
- `.codesummary`
|
|
116
|
+
- `.env`
|
|
117
|
+
- `.env.*`
|
|
118
|
+
- `.npmrc`
|
|
119
|
+
- `.yarnrc`
|
|
148
120
|
|
|
149
|
-
|
|
121
|
+
Publishing the docs site is a separate dashboard action.
|
|
150
122
|
|
|
151
|
-
|
|
123
|
+
## Non-Interactive Submit
|
|
124
|
+
|
|
125
|
+
For scripts or CI-style usage:
|
|
152
126
|
|
|
153
127
|
```bash
|
|
154
|
-
codesummary
|
|
155
|
-
codesummary
|
|
128
|
+
codesummary submit --depth standard
|
|
129
|
+
codesummary status --wait
|
|
156
130
|
```
|
|
157
131
|
|
|
158
|
-
|
|
159
|
-
auto-created private site. Later runs update that same source and can enqueue a
|
|
160
|
-
site draft update when the source knowledge job completes. Publishing the site
|
|
161
|
-
is still a separate dashboard action.
|
|
132
|
+
To verify setup without starting generation:
|
|
162
133
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
## Defaults
|
|
134
|
+
```bash
|
|
135
|
+
codesummary submit --no-generate
|
|
136
|
+
```
|
|
167
137
|
|
|
168
|
-
|
|
138
|
+
Product or site tokens are supported for scripted workflows:
|
|
169
139
|
|
|
170
|
-
|
|
171
|
-
|
|
140
|
+
```bash
|
|
141
|
+
export CODESUMMARY_API_KEY=csp_...
|
|
142
|
+
export CODESUMMARY_API_URL=https://dashboard.codesummary.io
|
|
172
143
|
|
|
173
|
-
|
|
174
|
-
|
|
144
|
+
codesummary link --site-token "$CODESUMMARY_API_KEY" --name my-repo
|
|
145
|
+
codesummary submit --depth standard
|
|
146
|
+
codesummary status --wait
|
|
147
|
+
```
|
|
175
148
|
|
|
176
|
-
## Local
|
|
149
|
+
## Local Export
|
|
177
150
|
|
|
178
|
-
|
|
179
|
-
locally:
|
|
151
|
+
Export manifest metadata without calling CodeSummary hosted infrastructure:
|
|
180
152
|
|
|
181
153
|
```bash
|
|
182
154
|
codesummary export --output ./codesummary-export
|
|
183
155
|
```
|
|
184
156
|
|
|
185
|
-
The
|
|
157
|
+
The export includes:
|
|
186
158
|
|
|
187
159
|
- `codesummary-manifest.json`
|
|
188
160
|
- `codesummary-export.json`
|
|
189
161
|
- `README.md`
|
|
190
162
|
|
|
191
|
-
To include
|
|
163
|
+
To include a filtered source archive in storage you control:
|
|
192
164
|
|
|
193
165
|
```bash
|
|
194
166
|
codesummary export --output s3://my-bucket/codesummary/my-repo --include-archive
|
|
195
167
|
```
|
|
196
168
|
|
|
197
|
-
S3 output uses
|
|
169
|
+
S3 output uses your local AWS credentials through `aws s3 sync`.
|
|
198
170
|
|
|
199
|
-
## Local
|
|
171
|
+
## Local Generation
|
|
200
172
|
|
|
201
|
-
|
|
202
|
-
|
|
173
|
+
Run documentation generation locally when you do not want to upload source code
|
|
174
|
+
to CodeSummary hosted infrastructure.
|
|
203
175
|
|
|
204
|
-
Use
|
|
176
|
+
Use your local Codex CLI session:
|
|
205
177
|
|
|
206
178
|
```bash
|
|
207
179
|
codesummary generate --provider codex --output ./docs
|
|
208
180
|
```
|
|
209
181
|
|
|
210
|
-
Configure
|
|
182
|
+
Configure defaults once:
|
|
211
183
|
|
|
212
184
|
```bash
|
|
213
185
|
codesummary configure --provider codex --output ./docs
|
|
214
186
|
codesummary generate
|
|
215
187
|
```
|
|
216
188
|
|
|
217
|
-
|
|
218
|
-
inference remains explicit with `codesummary generate` so it never spends local
|
|
219
|
-
provider credits by surprise.
|
|
220
|
-
|
|
221
|
-
Use a provider API key from your local environment:
|
|
189
|
+
Use a local provider API key:
|
|
222
190
|
|
|
223
191
|
```bash
|
|
224
192
|
export OPENAI_API_KEY=sk-...
|
|
225
193
|
codesummary generate --provider openai --api-key-env OPENAI_API_KEY --output ./docs
|
|
226
|
-
codesummary configure --provider openai --api-key-env OPENAI_API_KEY --output ./docs
|
|
227
194
|
|
|
228
195
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
229
196
|
codesummary generate --provider anthropic --api-key-env ANTHROPIC_API_KEY --output ./docs
|
|
230
|
-
codesummary configure --provider anthropic --api-key-env ANTHROPIC_API_KEY --output ./docs
|
|
231
197
|
```
|
|
232
198
|
|
|
233
|
-
|
|
199
|
+
Dry-run local packaging without inference:
|
|
234
200
|
|
|
235
201
|
```bash
|
|
236
|
-
codesummary generate --provider mock --output ./docs
|
|
237
202
|
codesummary generate --provider codex --output ./docs --dry-run
|
|
238
203
|
```
|
|
239
204
|
|
|
240
|
-
Local generation
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
output directory.
|
|
244
|
-
|
|
245
|
-
Security model:
|
|
205
|
+
Local generation does not send provider keys to CodeSummary. Provider keys stay
|
|
206
|
+
in your local environment, and `.codesummary/config.json` stores only the
|
|
207
|
+
provider name and environment variable name.
|
|
246
208
|
|
|
247
|
-
|
|
248
|
-
- `.codesummary/config.json` stores the provider choice and env var name, not the
|
|
249
|
-
provider key value.
|
|
250
|
-
- Codex mode uses the local Codex CLI/session; CodeSummary never sees that
|
|
251
|
-
credential.
|
|
252
|
-
- Source contents are sent only to the selected local provider.
|
|
253
|
-
- CodeSummary hosted infrastructure is not called by `generate`.
|
|
254
|
-
- Publishing or hosted site updates remain separate commands/flows.
|
|
209
|
+
## Version And Updates
|
|
255
210
|
|
|
256
|
-
|
|
211
|
+
```bash
|
|
212
|
+
codesummary version
|
|
213
|
+
codesummary update
|
|
214
|
+
```
|
|
257
215
|
|
|
258
|
-
|
|
216
|
+
`update` prints the npm command for upgrading the CLI:
|
|
259
217
|
|
|
260
218
|
```bash
|
|
261
|
-
|
|
262
|
-
codesummary whoami
|
|
263
|
-
codesummary diff
|
|
264
|
-
codesummary status
|
|
219
|
+
npm install -g @codesummary/cli@latest
|
|
265
220
|
```
|
|
266
221
|
|
|
267
|
-
|
|
222
|
+
## Maintainer Checks
|
|
223
|
+
|
|
224
|
+
Before releasing a new version:
|
|
268
225
|
|
|
269
226
|
```bash
|
|
270
227
|
npm test
|
|
271
228
|
npm run test:package
|
|
229
|
+
npm run release:check
|
|
272
230
|
```
|
|
273
231
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
provider-backed staging generation unless the operator explicitly approves the
|
|
277
|
-
credit spend.
|
|
278
|
-
|
|
279
|
-
The old `scripts/staging-e2e.sh` EC2/SSM flow is retired. Staging no longer has
|
|
280
|
-
that backend EC2 shape.
|
|
232
|
+
`test:package` runs `npm pack`, installs the tarball into a temporary project,
|
|
233
|
+
and verifies that the installed `codesummary` binary starts correctly.
|