Find all currently running Datasette instances and list their ports
Project description
datasette-ports
Find all currently running Datasette instances on your machine and list their ports, databases, versions and plugins.
Installation
Install this as a plugin in the same environment as Datasette.
datasette install datasette-ports
Or run it directly using uvx:
uvx datasette-ports
Or install it as a standalone tool:
uv tool install datasette-ports
datasette-ports
Usage
If installed as a Datasette plugin:
datasette ports
Or as a standalone command:
datasette-ports
This uses lsof to find all Python processes listening on TCP ports, then probes each one to check if it is a Datasette instance. For each instance found it displays the URL, Datasette version, attached databases and installed plugins.
Example output:
http://127.0.0.1:8007/ - v1.0a26
Directory: /Users/simon/dev/blog
Databases:
simonwillisonblog: /Users/simon/dev/blog/simonwillisonblog.db
Plugins:
datasette-llm
datasette-secrets
http://127.0.0.1:8001/ - v1.0a26
Directory: /Users/simon/dev/creatures
Databases:
creatures: /tmp/creatures.db
Plugins:
datasette-extract
datasette-llm
datasette-secrets
http://127.0.0.1:8900/ - v0.65.2
Databases:
logs: /Users/simon/Library/Application Support/io.datasette.llm/logs.db
http://0.0.0.0:8014/ - v1.0a26
Directory: /Users/simon/dev/datasette
Databases:
content: /Users/simon/dev/datasette/content.db
trees: /Users/simon/dev/datasette/trees.db
_internal
Plugins:
datasette-llm
datasette-visible-internal-db
Database paths come from each instance's /-/databases.json endpoint. Where the process working directory can be determined (via /proc/<pid>/cwd on Linux or lsof on macOS), relative paths are resolved to absolute ones. On platforms where the working directory cannot be determined the Directory: line is omitted and paths are shown as reported by Datasette.
JSON output
Use --json to get machine-readable output:
datasette ports --json
# or
datasette-ports --json
[
{
"url": "http://127.0.0.1:8007/",
"host": "127.0.0.1",
"port": 8007,
"pid": 42373,
"cwd": "/Users/simon/dev/blog",
"version": "1.0a26",
"databases": [
{"name": "simonwillisonblog", "path": "/Users/simon/dev/blog/simonwillisonblog.db"}
],
"plugins": [
"datasette-llm",
"datasette-secrets"
]
},
{
"url": "http://127.0.0.1:8900/",
"host": "127.0.0.1",
"port": 8900,
"pid": 12345,
"cwd": null,
"version": "0.65.2",
"databases": [
{"name": "logs", "path": "/Users/simon/Library/Application Support/io.datasette.llm/logs.db"}
],
"plugins": []
}
]
Development
To set up this project locally, first checkout the code. You can confirm it is available like this:
cd datasette-ports
uv run datasette-ports --help
# Or:
uv run datasette ports --help
To run the tests:
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette_ports-0.3.tar.gz.
File metadata
- Download URL: datasette_ports-0.3.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05a59fa1a8c4fb0ec6f86d0b4845980bff64baaa3f4835bd3adbe75a94c0a05e
|
|
| MD5 |
2d7cf67b55300911c956adcb65097825
|
|
| BLAKE2b-256 |
5d47946a11d33cb1afbebfc0e921f6b3bf9d531be486d124beefd8bfd97f3db5
|
Provenance
The following attestation bundles were made for datasette_ports-0.3.tar.gz:
Publisher:
publish.yml on datasette/datasette-ports
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_ports-0.3.tar.gz -
Subject digest:
05a59fa1a8c4fb0ec6f86d0b4845980bff64baaa3f4835bd3adbe75a94c0a05e - Sigstore transparency entry: 1302369298
- Sigstore integration time:
-
Permalink:
datasette/datasette-ports@347cdd33983c1aafbe3d612ceb12157639ee8375 -
Branch / Tag:
refs/tags/0.3 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@347cdd33983c1aafbe3d612ceb12157639ee8375 -
Trigger Event:
release
-
Statement type:
File details
Details for the file datasette_ports-0.3-py3-none-any.whl.
File metadata
- Download URL: datasette_ports-0.3-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25fd64d8e27b7c921b6b9b4e8ac861cfaf8a914214de73cd4f414fb86ae9cc7e
|
|
| MD5 |
6a224e48bbedfa81d2016db855bec9d1
|
|
| BLAKE2b-256 |
8125f4e68639834aac7f8f7e2587e4bac5ed3fc9fa4dde35bc5d42074eaabbb5
|
Provenance
The following attestation bundles were made for datasette_ports-0.3-py3-none-any.whl:
Publisher:
publish.yml on datasette/datasette-ports
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_ports-0.3-py3-none-any.whl -
Subject digest:
25fd64d8e27b7c921b6b9b4e8ac861cfaf8a914214de73cd4f414fb86ae9cc7e - Sigstore transparency entry: 1302369408
- Sigstore integration time:
-
Permalink:
datasette/datasette-ports@347cdd33983c1aafbe3d612ceb12157639ee8375 -
Branch / Tag:
refs/tags/0.3 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@347cdd33983c1aafbe3d612ceb12157639ee8375 -
Trigger Event:
release
-
Statement type: