Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.1 - 2026-10-27

`s1 login` adds `utm_source=search1api-cli` to the browser authorization URL, so Search1API can tell sign-ups that start from the CLI. No other behavior changes.

## 2.1.0 - 2026-10-26

Add `s1 feedback` to report wrong results, errors and missing capabilities to the Search1API team, built on the public Agentback SDK. Supports `--category`, `--intent`, `--request-id`, `--model`, `--json` and `-` for stdin. When logged in, the report carries the signed account.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search1api-cli",
"version": "2.1.0",
"version": "2.1.1",
"description": "CLI tool for Search1API - web search, news, crawl, sitemap, and trending",
"type": "module",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
const CALLBACK_PATH = "/callback";
const DEFAULT_TIMEOUT_MS = 5 * 60 * 1000;
const OAUTH_SCOPES = "openid profile email offline_access";
// Names the CLI as the source of sign-ups that start from `s1 login`.
const OAUTH_SOURCE = "search1api-cli";
const EXPIRY_SKEW_MS = 60_000;

const SUCCESS_HTML = `<!doctype html>
Expand Down Expand Up @@ -306,6 +308,7 @@ function buildAuthorizationUrl(
url.searchParams.set("state", state);
url.searchParams.set("code_challenge", codeChallenge);
url.searchParams.set("code_challenge_method", "S256");
url.searchParams.set("utm_source", OAUTH_SOURCE);
return url.toString();
}

Expand Down
1 change: 1 addition & 0 deletions tests/oauth-e2e.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ test("runs browser OAuth, PKCE, refresh, retry, and API-key fallback end to end"
/^http:\/\/127\.0\.0\.1:\d+\/callback$/
);
assert.equal(fixture.calls.authorization[0].code_challenge_method, "S256");
assert.equal(fixture.calls.authorization[0].utm_source, "search1api-cli");
assert.equal(fixture.calls.codeExchange.length, 1);
assert.equal(
fixture.calls.codeExchange[0].redirect_uri,
Expand Down
Loading