dataspring-cli 0.4.4__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
- cli/_skills/dataspring-author/SKILL.md +6 -3
- cli/_skills/dataspring-consume/SKILL.md +40 -17
- cli/auth.py +554 -149
- cli/forspring.py +478 -0
- cli/main.py +146 -52
- cli/refusals.py +93 -10
- {dataspring_cli-0.4.4.dist-info → dataspring_cli-0.5.0.dist-info}/METADATA +1 -1
- {dataspring_cli-0.4.4.dist-info → dataspring_cli-0.5.0.dist-info}/RECORD +10 -9
- {dataspring_cli-0.4.4.dist-info → dataspring_cli-0.5.0.dist-info}/WHEEL +0 -0
- {dataspring_cli-0.4.4.dist-info → dataspring_cli-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -13,7 +13,8 @@ affected entity. This skill exists so the conventions stay tight.
|
|
|
13
13
|
|
|
14
14
|
Every command and connection acts in ONE org, named each time; nothing
|
|
15
15
|
switches it for later. CLI: `dataspring auth login` prints a URL and a code
|
|
16
|
-
at once (run it in the background and hand both to the person
|
|
16
|
+
at once (run it in the background and hand both to the person; they approve
|
|
17
|
+
at their Forspring account and tick the orgs), then
|
|
17
18
|
`--org <org>`, `DATASPRING_ORG`, or `{"org": "<org>"}` in a
|
|
18
19
|
`.forspring.json` at the workspace root, which is the natural place:
|
|
19
20
|
|
|
@@ -21,8 +22,10 @@ at once (run it in the background and hand both to the person), then
|
|
|
21
22
|
echo '{"org": "acme"}' > .forspring.json && dataspring whoami --json
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
MCP:
|
|
25
|
-
|
|
25
|
+
MCP: `claude mcp add --transport http --scope user dataspring
|
|
26
|
+
https://dataspring.app/api/mcp/` (or the same address in any client); the
|
|
27
|
+
person signs in and the consent page names the org, bound to that connection.
|
|
28
|
+
With no person present: `Authorization: Bearer ds_...` (the key's own org).
|
|
26
29
|
|
|
27
30
|
A refusal leads with a reason and ends with its fix; match the reason. The
|
|
28
31
|
ones you meet while building: `role_too_low` (connections, pipelines,
|
|
@@ -8,8 +8,8 @@ description: How to query DataSpring correctly to answer analytical questions. U
|
|
|
8
8
|
You are querying DataSpring. Three surfaces are available — pick the
|
|
9
9
|
one the caller is using:
|
|
10
10
|
|
|
11
|
-
- **MCP** — agent connected to
|
|
12
|
-
|
|
11
|
+
- **MCP** — agent connected to DataSpring's MCP server (Claude.ai,
|
|
12
|
+
Claude Code, Cursor, etc.). Tool calls.
|
|
13
13
|
- **CLI** — `dataspring` from the terminal. Shell commands.
|
|
14
14
|
- **REST** — direct HTTP. Scripts, integrations.
|
|
15
15
|
|
|
@@ -69,22 +69,42 @@ People sign in with their Forspring account; who is in which org, with
|
|
|
69
69
|
which role, is the account's answer on every request. DataSpring has no
|
|
70
70
|
"current org": every command and every connection names one.
|
|
71
71
|
|
|
72
|
-
- **CLI.** `dataspring auth login` prints a URL and a code at once
|
|
73
|
-
until a person approves it
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
- **CLI.** `dataspring auth login` prints a URL and a code at once (on
|
|
73
|
+
stderr) and waits until a person approves it at their Forspring account
|
|
74
|
+
(`https://account.forspring.ai/device`; the machine running the CLI needs
|
|
75
|
+
no browser). Run it in the background, hand the person the URL and the
|
|
76
|
+
code, and wait for it to exit. On the account's page they tick the orgs
|
|
77
|
+
this CLI may act in; each becomes its own sign-in, kept in
|
|
78
|
+
`~/.forspring/credentials.json` (shared with the other Forspring CLIs, the
|
|
79
|
+
tokens in the OS keychain where there is one) for 30 days.
|
|
80
|
+
`--org <org>` on `auth login` asks for that one org. `ds_` keys an older
|
|
81
|
+
CLI stored still work. Signed in to one org, commands act in it. With
|
|
82
|
+
several, name the org on every command, in this order of precedence:
|
|
78
83
|
`--org <org>`, `DATASPRING_ORG` (then `FORSPRING_ORG`), or a
|
|
79
84
|
`.forspring.json` holding `{"org": "<org>"}` in the working directory or a
|
|
80
|
-
parent. `DATASPRING_API_KEY
|
|
85
|
+
parent. `DATASPRING_API_KEY` (CI: a `ds_` key, or an account `fpk_`/`fsa_`
|
|
86
|
+
key) always wins and acts in the key's own org.
|
|
81
87
|
`dataspring whoami --json` says which org a command here acts in and why
|
|
82
|
-
(`org_from
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
(`org_from`: `--org`, `DATASPRING_ORG`, `FORSPRING_ORG`,
|
|
89
|
+
`.forspring.json`, `key`, `only`) and with what (`credential.kind`:
|
|
90
|
+
`account`, `legacy` or `env`). There is no command that switches org for
|
|
91
|
+
later commands. `dataspring auth logout` signs out of the org named (or
|
|
92
|
+
the only one; `--all` for every one; several and none named is
|
|
93
|
+
`org_required`). It revokes before it forgets, says "revoked" only when
|
|
94
|
+
that was confirmed, and otherwise names where to revoke it by hand and
|
|
95
|
+
exits non-zero.
|
|
96
|
+
- **MCP.** The address is `https://dataspring.app/api/mcp/`, with no org
|
|
97
|
+
in it. Claude Code: `claude mcp add --transport http --scope user
|
|
98
|
+
dataspring https://dataspring.app/api/mcp/`, then `/mcp` → *Authenticate*
|
|
99
|
+
(`claude mcp login dataspring` with no browser); Claude.ai: *Customize →
|
|
100
|
+
Connectors* → *Add custom connector* with that URL. The person signs in
|
|
101
|
+
with their Forspring account and DataSpring's consent page names the org
|
|
102
|
+
the connection works in (their only one, or the one they choose); the
|
|
103
|
+
choice is bound to the connection. To work in two orgs, add two
|
|
104
|
+
connections; no tool moves a connection. With no person present (CI), the
|
|
105
|
+
same address takes `Authorization: Bearer ds_...` (a key made in the
|
|
106
|
+
console's connect page, under "Automation and CI"): the key acts in its
|
|
107
|
+
own org, and `?org=` may only repeat it.
|
|
88
108
|
- **REST.** `Authorization: Bearer ds_...`; the key is the org.
|
|
89
109
|
|
|
90
110
|
Never pick an org for the person. When the org is ambiguous you are refused
|
|
@@ -595,13 +615,16 @@ the reason, never on the prose, and pass the fix on verbatim.
|
|
|
595
615
|
| Reason | CLI exit | What you do |
|
|
596
616
|
|---|---|---|
|
|
597
617
|
| `not_signed_in` | 4 | CLI: run `dataspring auth login` and hand the person its URL and code. MCP: reconnect and sign in. Never ask for a password or a key in chat. |
|
|
598
|
-
| `org_required` | 2 | Several orgs, none named. Ask the person which one (the refusal lists them); then `--org`, `DATASPRING_ORG` or `.forspring.json`. Never guess. |
|
|
618
|
+
| `org_required` | 2 | Several orgs, none named. Ask the person which one (the refusal lists them); then `--org`, `DATASPRING_ORG` or `.forspring.json`. MCP: they reconnect and choose it on the consent page. Never guess. |
|
|
599
619
|
| `not_a_member` | 3 | Check the org id's spelling against the list. Otherwise only an owner or admin of that org can add the person, at the Forspring account; say so and stop. |
|
|
600
620
|
| `product_off` | 4 | DataSpring is not switched on for this person in that org. Tell them who can switch it on (`contacts`, `fix_url`); do not retry. |
|
|
601
621
|
| `org_suspended` | 4 | Billing stopped DataSpring for the whole org. Tell them an owner can restart it on the billing page; do not retry. |
|
|
602
622
|
| `role_too_low` | 4 | Their role cannot do this. Offer what it can do (a personal preference or quick metric instead of an org-wide change), or name the role needed. |
|
|
603
|
-
| `org_mismatch` | 4 | The key or connection is for another org than the one named. Use that org's key or
|
|
623
|
+
| `org_mismatch` | 4 | The key or connection (approved for one org) is for another org than the one named. Use that org's key or connection, or drop the conflicting `--org` / `?org=`. |
|
|
604
624
|
| `account_unavailable` | 1 | Forspring's account did not answer, so access could not be checked. Retry once after a few seconds; nothing changed. |
|
|
625
|
+
| `access_denied` | 4 | `auth login`: the person declined in the browser. Ask whether they meant to; run it again only if they say so. |
|
|
626
|
+
| `expired_token` | 5 | `auth login`: the code lapsed (ten minutes) before anyone approved it. Run it again and hand over the new code. |
|
|
627
|
+
| `slow_down` | 7 | `auth login`: too many sign-ins started from this address. Wait, then try again. |
|
|
605
628
|
|
|
606
629
|
Other CLI exits: 0 success, 1 any other failure, 2 a usage error, 64 a
|
|
607
630
|
removed command (it prints what replaced it).
|