Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5b5f153
Work out once whether a person, a coding agent or CI runs string
asavor Nov 20, 2026
f1aa517
Show update notices only to a person at a terminal
asavor Nov 20, 2026
2965b31
Say in the help and README how string finds a coding agent
asavor Nov 20, 2026
0a7ced0
Say in each request to String how string runs and which agent runs it
asavor Nov 20, 2026
5821244
Say in the help and README what each request tells String
asavor Nov 20, 2026
c43831d
Send the download host the same User-Agent as requests to String
asavor Nov 20, 2026
a6e36d4
Open a sign-in link in the browser only for a person at a terminal
asavor Nov 20, 2026
bd8003c
Wait for a person only when one is at the terminal
asavor Nov 20, 2026
744b748
Test that switches before update start no update check
asavor Nov 20, 2026
30068ae
Give each request to String a time limit
asavor Nov 20, 2026
6dd38e5
Bound sitemap --wait and say how to resume it
asavor Nov 20, 2026
4800d6b
Keep a sign-in's code when its server doesn't answer in time
asavor Nov 20, 2026
7c7b02c
Merge branch 'request-time-limits' into bounded-sitemap-wait
asavor Nov 20, 2026
e80c467
Bound login --poll and trial claim --poll and say how to resume them
asavor Nov 20, 2026
0c5815a
Say in the help and README how --poll waits and resumes
asavor Nov 20, 2026
60bea10
Say what Ctrl-C leaves behind, then end as an interrupted program
asavor Nov 20, 2026
b47aa9a
Say in the help and README what Ctrl-C does
asavor Nov 20, 2026
87502af
Give every command its own help, and take -h anywhere
asavor Nov 20, 2026
c13eb52
Say in the help and README how to get a command's help and the version
asavor Nov 20, 2026
5389a48
Suggest the command or flag meant, and take every spelling of a flag
asavor Nov 20, 2026
5ee2bc3
Say in the help and README which spellings work and what a typo gets
asavor Nov 20, 2026
534cf9b
Fetch a bare domain over https, and say when https:// was added
asavor Nov 20, 2026
aa7a92c
Say in the help and README that a bare domain works
asavor Nov 20, 2026
c147556
Add help topics, and start the help for all of string with lines for …
asavor Nov 20, 2026
f63fcff
Say in the help and README which help topics there are
asavor Nov 20, 2026
20d9042
Say in every JSON error its exit code, whether to retry, and the step…
asavor Nov 20, 2026
9798023
Say in the help and README what each JSON error field means
asavor Nov 20, 2026
7e0bb83
Write each error as error: and a sentence, without raw bodies
asavor Nov 20, 2026
5231315
Say in the help and README how an error reads
asavor Nov 20, 2026
952b5fb
Add --errors json, and say ahead what changes for fetch in 0.4
asavor Nov 20, 2026
7ceeaaa
Say in the help and README what --errors json does and what changes i…
asavor Nov 20, 2026
755cda4
Say a large page's size first, and what -o saved, with an outline
asavor Nov 20, 2026
e65ca51
Say in the help and README what -o says, what a large page says, and -q
asavor Nov 20, 2026
767931a
Read a long page in parts with --max-tokens, from one fetch
asavor Nov 20, 2026
69d23c2
Say in the help and README how to read a page in parts
asavor Nov 20, 2026
35d20ad
Check the key with String in whoami, and keep --offline local
asavor Nov 20, 2026
ef1f7a7
Say in the help and README that whoami checks the key
asavor Nov 20, 2026
8050af1
Refuse a JSON-only field with another format, and read --body-file - …
asavor Nov 20, 2026
2d88cfe
Say in the help and README how --body-file - and JSON-only fields work
asavor Nov 20, 2026
05e44f6
Keep a page from taking over a person's terminal, and refuse binary t…
asavor Nov 20, 2026
96cae2f
Say in the help and README what a person's terminal is spared
asavor Nov 20, 2026
9d0af97
Put the skill where agents read it, and add string skill
asavor Nov 20, 2026
dbdeb69
Rewrite the string-cli skill for 0.3, in 149 lines
asavor Nov 20, 2026
260e033
Say in the help and README where init puts the skill, and what string…
asavor Nov 20, 2026
dfc5f94
Give whoami --offline --json one JSON object
asavor Nov 20, 2026
65cba2e
Say in the README that whoami --json works with --offline too
asavor Nov 20, 2026
2a7b236
Merge main into whoami-offline-json
asavor Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ A key lifts those limits and unlocks every option, `request` and `sitemap`. Ther
export STRING_API_KEY="your-api-key"
```

`string whoami` shows which key commands use, the account it was saved for and the key's first characters, and checks it with String in one request that spends no credit. It exits 3 when String refuses the key, and 6 when it couldn't ask. `string whoami --offline` only says where the key comes from, as `whoami` did before. `string logout` deletes the saved key.
`string whoami` shows which key commands use, the account it was saved for and the key's first characters, and checks it with String in one request that spends no credit. It exits 3 when String refuses the key, and 6 when it couldn't ask. `string whoami --offline` only says where the key comes from, as `whoami` did before. With `--json`, either one prints one JSON object; only the checked one has `accepted`. `string logout` deletes the saved key.

An agent working with nobody present can register for a trial key instead, where the server offers it. `string trial` solves a few seconds' proof of work and saves a key with a small balance in the same file. The key doesn't expire; it works until its credit runs out. Beside it, in `trial.json`, it keeps a claim token, which a person can use for 7 days to adopt the agent onto their String account. Neither is printed. Where trial keys are switched off, `string trial` exits 3.

Expand Down
19 changes: 13 additions & 6 deletions cmd/string/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,17 @@ func whoamiCommand(list []string, rt runtime) error {
helpURL: helpURL,
}
}
source := "saved"
if key == env {
source = "STRING_API_KEY"
}
shown := map[string]any{"source": source, "credentials": path, "email": saved.Email, "key_prefix": keyPrefix(key)}
if parsed.switches["offline"] {
// Nothing asked String, so the object says nothing of accepted.
if rt.json {
encoded, _ := json.Marshal(shown)
return write(rt.stdout, append(encoded, '\n'))
}
return write(rt.stdout, []byte(said+".\n"))
}
// One request, which spends no credit, says whether String takes the key.
Expand All @@ -873,12 +883,9 @@ func whoamiCommand(list []string, rt runtime) error {
return &failure{exit: exitUpstream, code: "unverified", retryable: &yes, message: said + " (" + keyPrefix(key) + "), but string couldn't check it with String.", notes: []string{strings.TrimPrefix(asFailure(err).Error(), "error: ")}, nextStep: "run it again, or `string whoami --offline` to see the key without checking it"}
}
if rt.json {
source := "saved"
if key == env {
source = "STRING_API_KEY"
}
shown, _ := json.Marshal(map[string]any{"source": source, "credentials": path, "email": saved.Email, "key_prefix": keyPrefix(key), "accepted": true})
return write(rt.stdout, append(shown, '\n'))
shown["accepted"] = true
encoded, _ := json.Marshal(shown)
return write(rt.stdout, append(encoded, '\n'))
}
return write(rt.stdout, []byte(said+" ("+keyPrefix(key)+"). String accepts it.\n"))
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/string/whoami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ func TestWhoamiChecksTheKeyWithString(t *testing.T) {
if got := whoami(offline, "", true, "--offline"); got.status != 0 || !strings.HasPrefix(got.output, "Logged in as dev@localhost, with the key saved in ") || !strings.HasSuffix(got.output, "credentials.json.\n") {
t.Errorf("--offline: %+v", got)
}
// With --json, --offline gives the object too, without accepted, since
// nothing asked String.
got = whoami(offline, envKey, false, "--offline", "--json")
if shown, _ := decode(t, got.output).(map[string]any); got.status != 0 || shown["source"] != "STRING_API_KEY" || shown["key_prefix"] != "env-key-…" || shown["accepted"] != nil {
t.Errorf("--offline --json: %+v", got)
}
if got := whoami(offline, "", false); got.status != exitAuth || !strings.HasPrefix(got.errors, "error: Not logged in.") {
t.Errorf("no key: %+v", got)
}
Expand Down
Loading