mirror of
https://github.com/simonw/dclient.git
synced 2026-08-10 11:24:12 +02:00
66 lines
1.5 KiB
Markdown
66 lines
1.5 KiB
Markdown
# dclient
|
|
|
|
[](https://pypi.org/project/dclient/)
|
|
[](https://github.com/simonw/dclient/releases)
|
|
[](https://github.com/simonw/dclient/actions?query=workflow%3ATest)
|
|
[](https://github.com/simonw/dclient/blob/master/LICENSE)
|
|
|
|
A client CLI utility for Datasette instances
|
|
|
|
## Installation
|
|
|
|
Install this tool using `pip`:
|
|
|
|
pip install dclient
|
|
|
|
## Usage
|
|
|
|
For help, run:
|
|
|
|
dclient --help
|
|
|
|
You can also use:
|
|
|
|
python -m dclient --help
|
|
|
|
### dclient query
|
|
|
|
<!-- [[[cog
|
|
import cog
|
|
from dclient import cli
|
|
from click.testing import CliRunner
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli.cli, ["query", "--help"])
|
|
help = result.output.replace("Usage: cli", "Usage: dclient")
|
|
cog.out(
|
|
"```\n{}\n```".format(help)
|
|
)
|
|
]]] -->
|
|
```
|
|
Usage: dclient query [OPTIONS] URL SQL
|
|
|
|
Run a SQL query against a Datasette database URL
|
|
|
|
Returns a JSON array of objects
|
|
|
|
Options:
|
|
--help Show this message and exit.
|
|
|
|
```
|
|
<!-- [[[end]]] -->
|
|
|
|
## Development
|
|
|
|
To contribute to this tool, first checkout the code. Then create a new virtual environment:
|
|
|
|
cd dclient
|
|
python -m venv venv
|
|
source venv/bin/activate
|
|
|
|
Now install the dependencies and test dependencies:
|
|
|
|
pip install -e '.[test]'
|
|
|
|
To run the tests:
|
|
|
|
pytest
|