Skip to main content

FX project and DevOps operations CLI.

Project description

fx-tool

fx is the grouped project manager and operations CLI for projects built on registers. It is implemented as a first-class registers.cli application: commands are grouped, results are structured, global context is supported, and plain output remains automation-friendly.

Install

pip install fx-tool
pip install "fx-tool[cli]"

The cli extra enables the optional registers.cli Rich and prompt_toolkit integrations for styled help, tables, completion, history, and multiline shell input. Without the extra, fx falls back to standard-library plain text.

Quick Start

fx project init cli MyTool
fx project status MyTool
fx project health MyTool
fx run cli MyTool

DB/FastAPI project:

fx project init db ApiService --layout src
fx run api ApiService --host 0.0.0.0 --port 9000 --reload

Cron project:

fx project init cron OpsJobs
fx cron jobs OpsJobs
fx cron trigger OpsJobs sync-cache --payload '{"dry_run":true}'

Use a global root when repeatedly operating on one project:

fx --root MyTool project status
fx --root MyTool module list
fx --root OpsJobs cron status --output json

Command Model

fx intentionally supports grouped commands only. Legacy flat forms such as fx init, fx status, fx run ., fx install, fx update, and action-router cron forms are removed.

project init|status|health|history
module add|list|remove
plugin link|list|unlink|sync
run auto|cli|api|cron
package install|update|pull
cron jobs|trigger|start|stop|status|workspace|register|workflows|run-workflow|generate|apply

Output Modes

Commands return dictionaries or lists of dictionaries where possible. That makes the same command useful for humans and scripts:

fx project status MyTool
fx project status MyTool --output json
fx module list MyTool --output csv
fx cron jobs OpsJobs --quiet
fx cron status OpsJobs --no-color

If a command ever owns an output argument, use the framework alias:

fx some command --output report.txt --cli-output json

Safety

Changing commands support --dry-run where practical:

fx project init cli MyTool --dry-run
fx module add MyTool cli users --dry-run
fx plugin link MyTool my_package.tools tools --dry-run
fx package install MyTool --dry-run
fx cron trigger OpsJobs sync-cache --payload '{"x":1}' --dry-run

Destructive state operations require confirmation in interactive sessions or --force in automation:

fx module remove MyTool users --force
fx plugin unlink MyTool tools --force
fx cron apply OpsJobs --target linux_cron --force

Interactive Shell

Start the shell explicitly:

fx --interactive

Embedded callers can enable optional shell UX:

from fx import run

run(
    ["--interactive"],
    rich=True,
    completion=True,
    history=True,
    multiline=True,
)

Shell built-ins include help, commands, watch <command> --interval N --count N, pipe <command> | filter FIELD=VALUE | sort FIELD | count, exec <system command>, and exit.

Project Layouts

The default layout is src/<package>/. Use --layout root to create <root>/<package>/, and --package <name> to choose the package name.

CLI projects create a grouped registers.cli starter command. DB projects also create api.py and models.py; DB projects run through Uvicorn as <package>.api:app. Cron projects also create jobs.py and install the script-local registers.cron CLI inside main().

Development

python -m pytest tests/fx
python -m pytest tests

For source-tree smoke checks without reinstalling:

$env:PYTHONPATH="C:\Users\charl\Documents\Python\framework\fx\src;C:\Users\charl\Documents\Python\framework\registers\src"
python -m fx --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fx_tool-1.2.4.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fx_tool-1.2.4-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file fx_tool-1.2.4.tar.gz.

File metadata

  • Download URL: fx_tool-1.2.4.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fx_tool-1.2.4.tar.gz
Algorithm Hash digest
SHA256 7b112cd32be4b8606f39549b625f1112be727af52dd34e4ec24e3331c0ee0ff9
MD5 c5c7bb35fb79a7499dcd8df6bf42ab02
BLAKE2b-256 3fd94ef27db3355fccfef135fdff545b01962504ec01f44995c389f6f8824835

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_tool-1.2.4.tar.gz:

Publisher: publish.yml on nexustech101/fx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fx_tool-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: fx_tool-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fx_tool-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5f6935f909dca8b3c13234e7210940a5e2391f9a95c4cb6a8d57753d3147cd68
MD5 1a1fe4c379ec36a538ec909d80d524e0
BLAKE2b-256 792a437a7f8b87cf84b1f5475015439aca5146021833aede1c0af24eda08aa95

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_tool-1.2.4-py3-none-any.whl:

Publisher: publish.yml on nexustech101/fx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page