New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request]datasette install plugins.json
options
#2133
Comments
Neat idea! We already have this command:
So maybe |
diff --git a/datasette/cli.py b/datasette/cli.py
index 32266888..370b722c 100644
--- a/datasette/cli.py
+++ b/datasette/cli.py
@@ -223,15 +223,22 @@ pm.hook.publish_subcommand(publish=publish)
@cli.command()
@click.option("--all", help="Include built-in default plugins", is_flag=True)
+@click.option(
+ "--requirements", help="Output requirements.txt of installed plugins", is_flag=True
+)
@click.option(
"--plugins-dir",
type=click.Path(exists=True, file_okay=False, dir_okay=True),
help="Path to directory containing custom plugins",
)
-def plugins(all, plugins_dir):
+def plugins(all, requirements, plugins_dir):
"""List currently installed plugins"""
app = Datasette([], plugins_dir=plugins_dir)
- click.echo(json.dumps(app._plugins(all=all), indent=4))
+ if requirements:
+ for plugin in app._plugins():
+ click.echo("{}=={}".format(plugin["name"], plugin["version"]))
+ else:
+ click.echo(json.dumps(app._plugins(all=all), indent=4))
@cli.command() Output:
|
Yes, using this approach( I'm curious about the results of the |
Honestly the The purpose of |
Plugin configuration itself currently lives in I'm hoping to fix that for Datasette 1.0, but I'm still figuring out how to do that. |
Problem - if there are plugins in the plugins directory it was returning this:
|
I'm going to have it only return plugins with a version other than |
It looks very nice now. |
* API explorer requires view-instance permission * Check database/table permissions on /-/api page * Release notes for 1.0a4 Refs #2119, #2133, #2138, #2140 Refs GHSA-7ch3-7pp7-7cpq
Hi, simon ❤️
datasette plugins --all > plugins.json
could generate all plugins info. On another machine, it would be great to install all plugins just bydatasette install plugins.json
The text was updated successfully, but these errors were encountered: