feat(cli): add takopi config subcommand (#153)

This commit is contained in:
banteg
2026-01-16 11:28:06 +04:00
committed by GitHub
parent dec93019b1
commit 92b33c5181
25 changed files with 1248 additions and 246 deletions
+36 -12
View File
@@ -52,10 +52,18 @@ BACKEND = EngineBackend(
Engine config is a raw table in `takopi.toml`:
```toml
[myengine]
model = "..."
```
=== "takopi config"
```sh
takopi config set myengine.model "..."
```
=== "toml"
```toml
[myengine]
model = "..."
```
## Transport backend plugin
@@ -92,19 +100,35 @@ BACKEND = MyCommand()
Configure under `[plugins.<id>]`:
```toml
[plugins.hello]
greeting = "hello"
```
=== "takopi config"
```sh
takopi config set plugins.hello.greeting "hello"
```
=== "toml"
```toml
[plugins.hello]
greeting = "hello"
```
The parsed dict is available as `ctx.plugin_config` in `handle()`.
## Enable/disable installed plugins
```toml
[plugins]
enabled = ["takopi-transport-slack", "takopi-engine-acme"]
```
=== "takopi config"
```sh
takopi config set plugins.enabled '["takopi-transport-slack", "takopi-engine-acme"]'
```
=== "toml"
```toml
[plugins]
enabled = ["takopi-transport-slack", "takopi-engine-acme"]
```
- `enabled = []` (default) means “load all installed plugins”.
- If non-empty, only distributions with matching names are visible.