Commit graph

72 commits

Author SHA1 Message Date
Simon Willison
ed589d34cf
Release 0.5a2 0.5a2
Refs #30, #31, #32, #33, #34
2026-02-26 21:55:56 -08:00
Simon Willison
54df24db5e --read/--write options plus --token-only, closes #34 2026-02-26 21:45:58 -08:00
Simon Willison
e8d80a6495 Logging in with OAuth docs 2026-02-26 21:25:56 -08:00
Simon Willison
0b590d1a6f dclient rows command, closes #33 2026-02-26 21:19:32 -08:00
Simon Willison
1340f68255 Ran cog 2026-02-26 21:04:25 -08:00
Simon Willison
021c595de4 dclient create-table, closes #32 2026-02-26 21:03:17 -08:00
Simon Willison
f2aea1b108 --csv, --tsv, --nl, -t/--table output formats, closes #31 2026-02-26 20:56:22 -08:00
Simon Willison
2f7f2a7378 Moved default commands to dclient default ..., closes #30 2026-02-26 20:44:39 -08:00
Simon Willison
7a8643f72f Justfile now uses uv, docs gets a dependency group 2026-02-26 20:43:18 -08:00
Simon Willison
04e396b020 Release 0.5a1 0.5a1 2026-02-26 15:25:22 -08:00
Simon Willison
9df1828d1d Set defaults on login, if not already set 2026-02-26 15:25:06 -08:00
Simon Willison
9b03289e3a Tests now use Datasette 1.0a25+ 0.5a0 2026-02-26 15:05:43 -08:00
Simon Willison
ebb8268d51
Release 0.5a0
Refs #29
2026-02-26 15:00:49 -08:00
Simon Willison
4df076d1f0 Initial oauth flow for use with datasette-oauth 2026-02-26 15:00:15 -08:00
Simon Willison
7be5d4a53f Merge branch 'v2'
# Conflicts:
#	docs/authentication.md
2026-02-26 14:39:57 -08:00
Simon Willison
7b3a15027e Add instances command, improve error messages with actionable hints
Add "dclient instances" command to list known instances from config,
with --json support.

Improve "No instance specified" and "No database specified" error
messages to show the exact commands needed to fix the problem.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:25:57 -08:00
Simon Willison
3f3221fdd3 Update README and docs index for v2
Update examples to use v2 command syntax with -i flag and alias
defaults. Add quick start section showing alias add/default/default-db
workflow. Add introspection commands section. Add environment.md to
docs toctree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:22:12 -08:00
Simon Willison
742d46de05 v1 to v2 config migration with tests
Add _migrate_v1_to_v2() to convert aliases.json to config.json format.
Single-path-segment URLs are split into instance URL + default_database.
Auth keys are migrated from URLs to alias names. Original files are
backed up as .bak.

7 tests covering simple migration, no path segment, auth migration,
URL fallback for unmatched auth, skip if config exists, skip if no
aliases, and multi-path-segment URLs.

refs #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:22:05 -08:00
Simon Willison
92c0d2a5ba Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.

Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.

Update aliases.md and authentication.md docs for v2 API.

refs #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
Simon Willison
3621f13263 v2 config system, CLI rewrite, and updated core commands
Replace aliases.json with config.json storing instances with
default_database. Instance resolution: -i flag → config default →
DATASETTE_URL. Database resolution: -d flag → instance default_database →
DATASETTE_DATABASE. Token resolution: --token → auth.json by alias →
auth.json by URL → DATASETTE_TOKEN.

Add click-default-group dependency for bare SQL shortcut support.
Add DCLIENT_CONFIG_DIR env var to override config directory.

Rewrite query, insert, get, and actor commands for v2 API where
instance is always -i flag. Add upsert command sharing insert
implementation. Add databases, tables, schema, plugins commands.
Add default_query hidden command for bare SQL shortcut.

Add alias default, alias default-db subcommands.
Add auth status subcommand.

refs #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:52 -08:00
Simon Willison
cf565e3eb6 Ran cog 2026-02-24 15:00:27 -08:00
Simon Willison
ff95969d10 Ran cog 2026-02-24 14:59:23 -08:00
Simon Willison
7c9c0b4f5f Spec for v2, refs #29 2026-02-24 14:57:54 -08:00
Simon Willison
f47738495d Add tables command to list tables in a database
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:57:18 -08:00
Simon Willison
8b98d971dd Add databases command to list databases on an instance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:57:06 -08:00
Simon Willison
d1dfdbf6db Add get command for authenticated GET requests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:56:54 -08:00
Simon Willison
1b4dc85974 actor command: make URL optional, fix actor URL construction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:56:40 -08:00
Simon Willison
4cb77386c7 _resolve_url falls back to DATASETTE_URL when no URL provided
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:56:27 -08:00
Simon Willison
166798c87c Follow redirects on query
Means that the 1.0 feature where /db?sql is now /db/-/query?sql works
2026-02-23 22:14:00 -08:00
Simon Willison
32124a0bf3 Support DATASETTE_URL and DATASETTE_TOKEN environment variables
Allow configuring a base Datasette instance URL and API token via
environment variables, so users can run commands like
`dclient query data "select ..."` without specifying a full URL each time.

DATASETTE_URL is combined with the argument as a path segment.
DATASETTE_TOKEN is used as a lowest-priority fallback for auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:10:59 -08:00
Simon Willison
ab3aaf26f3 Fixed asyncio pattern for tests 2026-02-23 21:43:23 -08:00
Simon Willison
a157065c31 setup.py to pyproject.toml plus upgraded actions 2026-02-23 16:50:33 -08:00
Simon Willison
1a0fe65015 Upgrade Actions for publish of 0.4 0.4 2024-03-08 11:09:54 -05:00
Simon Willison
0d4ab72b68 Release 0.4
Refs #23, #25, #26
2024-02-27 21:09:26 -08:00
Simon Willison
ea3dc64fb9 dclient actor command, closes #26 2024-02-27 21:08:15 -08:00
Simon Willison
20851f6ed6 -v/--verbose option, closes #25 2024-02-27 20:52:15 -08:00
Simon Willison
adfa6cce14 insert --alter support, closes #23 2024-02-27 20:49:54 -08:00
Simon Willison
0e40a80c84 Deploy future packages with PyPI trusted actions 2024-02-25 11:38:22 -08:00
Simon Willison
5303067da3 Release 0.3 0.3
Refs #8, #16, #18, #19, #21, #22
2024-02-25 11:36:27 -08:00
Simon Willison
081aeb32a2 Example usage in --help, closes #22 2024-02-25 11:24:46 -08:00
Simon Willison
f0058258b2 cog --check as part of CI 2024-02-25 11:13:35 -08:00
Simon Willison
8c82f9a572 Rename 'datasette client' to 'datasette dt', closes #18
Refs https://github.com/simonw/datasette/issues/2153#issuecomment-1691763427
2024-02-25 11:10:53 -08:00
Simon Willison
44d7e2bf9e Docs for streaming and --interval, closes #21 2024-02-25 11:08:02 -08:00
Simon Willison
5a0a81b8da
Create .readthedocs.yaml 2024-02-24 17:44:06 -08:00
Simon Willison
37423fe772 Drop Python 3.7, add 3.12 2024-02-23 20:08:30 -08:00
Simon Willison
43b6850780 --interval option, refs #19 2024-02-23 20:08:30 -08:00
Simon Willison
59129824e3 Update for Datasette 1.0 alphas to pass tests 2024-02-23 19:56:56 -08:00
Simon Willison
66a3cdd3be Remove query -t shortcut - so I can use it for table later, refs #16 2023-07-24 21:52:53 -07:00
Simon Willison
a17b7f6e7d Add dclient insert --help to insert docs, refs #8 2023-07-24 21:35:50 -07:00
Simon Willison
ce62592540
Demonstrate aliases directly in the README 2023-07-24 21:33:46 -07:00