@typeship-ax/cli 0.8.0 → 0.10.0
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/AGENTS.md +31 -0
- package/README.md +26 -9
- package/api.json +3509 -800
- package/api.md +444 -494
- package/dist/api-identity.d.ts +40 -0
- package/dist/api-identity.d.ts.map +1 -0
- package/dist/api-identity.js +128 -0
- package/dist/auth-profiles.d.ts +30 -0
- package/dist/auth-profiles.d.ts.map +1 -0
- package/dist/auth-profiles.js +138 -0
- package/dist/cli.js +522 -355
- package/dist/console-login-check.d.ts +21 -0
- package/dist/console-login-check.d.ts.map +1 -0
- package/dist/console-login-check.js +107 -0
- package/dist/console-login-contract.d.ts +45 -0
- package/dist/console-login-contract.d.ts.map +1 -0
- package/dist/console-login-contract.js +40 -0
- package/dist/core/http.d.ts +17 -2
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +78 -17
- package/dist/credential-storage.d.ts +24 -0
- package/dist/credential-storage.d.ts.map +1 -0
- package/dist/credential-storage.js +207 -0
- package/dist/docs.d.ts +25 -0
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +144 -0
- package/dist/errors.d.ts +18 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +24 -14
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -4
- package/dist/named-credentials.d.ts +21 -0
- package/dist/named-credentials.d.ts.map +1 -0
- package/dist/named-credentials.js +86 -0
- package/dist/oauth-login.d.ts +39 -0
- package/dist/oauth-login.d.ts.map +1 -0
- package/dist/oauth-login.js +171 -0
- package/dist/oauth-request.d.ts +21 -0
- package/dist/oauth-request.d.ts.map +1 -0
- package/dist/oauth-request.js +119 -0
- package/dist/oauth-session.d.ts +106 -0
- package/dist/oauth-session.d.ts.map +1 -0
- package/dist/oauth-session.js +244 -0
- package/dist/ops.d.ts +14 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +34 -30
- package/dist/polling-login.d.ts +57 -0
- package/dist/polling-login.d.ts.map +1 -0
- package/dist/polling-login.js +204 -0
- package/dist/resources/account.d.ts +2 -2
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +1 -0
- package/dist/resources/api-keys.d.ts +3 -3
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +2 -0
- package/dist/resources/definition-revisions.d.ts +5 -5
- package/dist/resources/definition-revisions.d.ts.map +1 -1
- package/dist/resources/definition-revisions.js +4 -0
- package/dist/resources/definitions.d.ts +15 -4
- package/dist/resources/definitions.d.ts.map +1 -1
- package/dist/resources/definitions.js +11 -2
- package/dist/resources/generate.d.ts +14 -3
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +10 -2
- package/dist/resources/generations.d.ts +3 -3
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +2 -0
- package/dist/resources/projects.d.ts +56 -20
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +40 -4
- package/dist/resources/targets.d.ts +84 -10
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +127 -2
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +55 -26
- package/dist/types.d.ts +602 -123
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +24 -0
- package/package.json +2 -1
- package/src/api-identity.ts +98 -0
- package/src/auth-profiles.ts +114 -0
- package/src/cli.ts +444 -332
- package/src/console-login-check.ts +88 -0
- package/src/console-login-contract.ts +65 -0
- package/src/core/http.ts +88 -19
- package/src/credential-storage.ts +183 -0
- package/src/docs.ts +138 -0
- package/src/errors.ts +26 -15
- package/src/index.ts +29 -4
- package/src/named-credentials.ts +74 -0
- package/src/oauth-login.ts +184 -0
- package/src/oauth-request.ts +90 -0
- package/src/oauth-session.ts +258 -0
- package/src/ops.ts +48 -31
- package/src/polling-login.ts +165 -0
- package/src/resources/account.ts +3 -0
- package/src/resources/api-keys.ts +5 -0
- package/src/resources/definition-revisions.ts +9 -0
- package/src/resources/definitions.ts +25 -0
- package/src/resources/generate.ts +23 -0
- package/src/resources/generations.ts +5 -0
- package/src/resources/projects.ts +95 -7
- package/src/resources/targets.ts +241 -0
- package/src/schemas.ts +55 -26
- package/src/types.ts +640 -123
package/AGENTS.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# typeship — agent context
|
|
2
|
+
|
|
3
|
+
This package contains the generated CLI for **typeship** (API v1.0.0, package v0.10.0).
|
|
4
|
+
|
|
5
|
+
Resolve an OpenAPI or GraphQL Definition, diagnose it, and keep every
|
|
6
|
+
selected SDK, CLI, and MCP Target current.
|
|
7
|
+
|
|
8
|
+
Every operation but one requires a bearer credential: an organization
|
|
9
|
+
API key from the console, or an OAuth access token carrying the operation's
|
|
10
|
+
read, generate, or write capability and the organization selected during
|
|
11
|
+
consent. OAuth grants cannot switch organizations after consent. A browser
|
|
12
|
+
session is not a credential for this API. The exception is POST /generate,
|
|
13
|
+
which works anonymously with the free plan's limits.
|
|
14
|
+
|
|
15
|
+
## Ground rules
|
|
16
|
+
- Typeship owns the files it generates. Change the API definition, generation settings, or definition patches, then regenerate those files. Repository delivery preserves files outside its generated-file ownership manifest; preserving a file does not add it to the package's exports, build, or tests.
|
|
17
|
+
- Zero runtime dependencies; the program runs on Node.js 18+ and platform `fetch`.
|
|
18
|
+
- `api.md` is the command and flag reference; `api.json` is the machine-readable operation, schema, safety, and example contract. Read them before guessing.
|
|
19
|
+
- Start with the local build or installation instructions in `README.md`. Generation does not publish a registry package.
|
|
20
|
+
|
|
21
|
+
## Authentication
|
|
22
|
+
- Bearer token: set the `TYPESHIP_TOKEN` environment variable.
|
|
23
|
+
|
|
24
|
+
## Using the CLI
|
|
25
|
+
- `typeship <resource> <command>` calls an API operation; `typeship docs search <term> --json` finds operations and guides as structured data; `typeship docs <resource> <command>` gives a concise contract and example (add `--schema` for full schemas or `--json` for the machine contract).
|
|
26
|
+
- Path parameters are positional; other inputs are flags. JSON goes to stdout and exit codes are 0/1/2. Errors are one JSON envelope on stderr: `{status, issues: [{code, message}], next_steps, detail}`; branch on `issues[].code`. Every operation classified as destructive requires `--force` (or `--yes`).
|
|
27
|
+
- `typeship agent-guide --format json` explains the conventions; `typeship help --json` is the command surface as data; `typeship doctor` checks the setup. Read `typeship init --help` before setup: it can store credentials and update agent instructions. Choose the scope the task requires.
|
|
28
|
+
|
|
29
|
+
## Documentation
|
|
30
|
+
- The reference for this exact package: `api.md` (offline, always current with the code).
|
|
31
|
+
- Conceptual guides live on the docs site. For questions about how the API's concepts fit together (flows, ordering, environments), fetch `https://typeship.dev/llms-full.txt` and read the relevant sections; `https://typeship.dev/llms.txt` is the page index. Relative links in the spec resolve against `https://typeship.dev`.
|
package/README.md
CHANGED
|
@@ -4,13 +4,27 @@ CLI for typeship. [API reference](./api.md)
|
|
|
4
4
|
|
|
5
5
|
Generated from the OpenAPI spec by [typeship](https://typeship.dev). Change the spec or generation settings, then regenerate; generated files are not hand-edited.
|
|
6
6
|
|
|
7
|
-
- **Zero runtime dependencies** — built on the platform `fetch`
|
|
7
|
+
- **Zero runtime dependencies** — built on the platform `fetch` in Node 18+
|
|
8
8
|
- **Spec-native CLI** — every operation is a command with typed flags, stable JSON, help, and exit codes
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Build from source
|
|
11
|
+
|
|
12
|
+
Run these commands in the downloaded or cloned package directory:
|
|
11
13
|
|
|
12
14
|
```sh
|
|
13
|
-
npm install
|
|
15
|
+
npm install
|
|
16
|
+
npm run build
|
|
17
|
+
node dist/cli.js --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Requires Node.js 18+. The package is ESM.
|
|
21
|
+
|
|
22
|
+
## Install a published package
|
|
23
|
+
|
|
24
|
+
Generation does not publish a package. Before using the registry command below, confirm `name` and `version` in `package.json`, publish under a name you control, and verify that release is available on npm.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install --global @typeship-ax/cli@0.10.0
|
|
14
28
|
```
|
|
15
29
|
|
|
16
30
|
## CLI
|
|
@@ -18,13 +32,14 @@ npm install @typeship-ax/cli
|
|
|
18
32
|
The package ships `typeship`, a command for every API operation. API commands write JSON to stdout; discovery commands offer `--json`. Exit codes 0/1/2 mean success, request failure, and invalid usage.
|
|
19
33
|
|
|
20
34
|
```sh
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
typeship <resource> <command> --help # flags, types, an example
|
|
35
|
+
node dist/cli.js login # stores a credential (or set TYPESHIP_TOKEN)
|
|
36
|
+
node dist/cli.js account retrieve
|
|
37
|
+
node dist/cli.js projects list --all # every page, one item per line
|
|
38
|
+
node dist/cli.js help --json # command names, flags, and types
|
|
26
39
|
```
|
|
27
40
|
|
|
41
|
+
These examples run from the package directory. After a global installation, use `typeship` in place of `node dist/cli.js`.
|
|
42
|
+
|
|
28
43
|
CLI conventions:
|
|
29
44
|
|
|
30
45
|
- Path parameters are positional; query and body fields are flags named after their wire fields.
|
|
@@ -32,7 +47,9 @@ CLI conventions:
|
|
|
32
47
|
- `--fields id,name` projects results. `--all` streams paginated results as NDJSON.
|
|
33
48
|
- Destructive commands require confirmation or `--force`. Piped errors are stable JSON on stderr.
|
|
34
49
|
|
|
35
|
-
Auth: `typeship login` stores a credential under `~/.config/typeship/`; the environment (`TYPESHIP_TOKEN`) and flags (`--token`) win over it. `TYPESHIP_BASE_URL` / `--base-url` pick the endpoint.
|
|
50
|
+
Auth: `typeship login` stores a credential under `~/.config/typeship/profiles/default/`; the environment (`TYPESHIP_TOKEN`) and flags (`--token`) win over it. `TYPESHIP_BASE_URL` / `--base-url` pick the endpoint.
|
|
51
|
+
|
|
52
|
+
Use `typeship login --profile work` for a separate login, `typeship auth use work` to select it, and `typeship auth profiles` to list profiles without exposing tokens. Selection follows `--profile`, then `TYPESHIP_PROFILE`, then the saved selection, then `default`. Profiles isolate saved settings and credentials; an API or environment change requires another login before using the saved credential.
|
|
36
53
|
|
|
37
54
|
Useful commands:
|
|
38
55
|
|