Skip to main content

FX project and DevOps operations CLI.

Project description

fx-tool

fx is the project manager and operations CLI for projects built on registers.

It is designed for both local developer workflows and operational workflows:

  • scaffold new projects (cli and db)
  • add plugin/modules and keep plugin registry aligned with filesystem
  • run/install/update projects
  • pull plugins from repositories
  • manage cron jobs, workflows, and runtime state
  • record local operation history in .fx/fx.db

Install

Install from PyPI:

pip install fx-tool

For local development:

pip install -e ".[dev]"

Entrypoints:

fx --version
fx --help
fx --interactive
python -m fx --help

Quick Start

CLI project:

fx init cli TodoApp
fx status TodoApp
fx health TodoApp
fx run TodoApp

DB/API project:

fx init db DataApp
fx status DataApp
fx health DataApp
fx run DataApp --host 0.0.0.0 --port 9000 --reload

Typical Scaffold Output (fx init)

CLI projects create:

app/__main__.py
app/todo.py
app/plugins/__init__.py
tests/test_todo_automation.py
pyproject.toml
README.md
.fx/fx.db

DB projects create:

app/__main__.py
app/models.py
app/api.py
app/plugins/__init__.py
tests/test_user_api.py
pyproject.toml
README.md
.fx/fx.db

Interactive Shell (TUI-Style REPL)

Launch interactive mode:

fx --interactive

Built-ins:

  • help
  • help <command>
  • commands
  • exec <system command>
  • exit / quit

Example scripted session:

commands
help module
exec echo hello-from-shell
quit

The generated app started by fx run <cli_project> also opens an interactive console (same built-in model) and exits cleanly on EOF/non-interactive input.

Command Style and Argument Rules

fx uses registers.cli parsing conventions:

  • positional and named forms are both supported
  • named options accept both snake and kebab case
  • boolean values are flags (--force, --reload, --foreground)
  • grouped commands are top-level (module, plugin, cron) with action args

Examples:

fx init cli MyProject .
fx init --project-type cli --project-name MyProject --root .
fx module add cli users .
fx run . --host 0.0.0.0 --port 9000 --reload

Command Reference

init

Initialize project structure and local fx state.

fx init
fx init cli
fx init cli MyProject
fx init cli MyProject .
fx init db DataProject .
fx init cli MyProject . --force

Backward-compatible forms are supported:

fx init MyProject
fx init MyProject .

status

Inspect project structure and registry status:

fx status .

Includes:

  • project record/type
  • package and plugin package discovery
  • starter file checks (todo.py, api.py, models.py)
  • registered modules/plugins
  • registry vs filesystem plugin alignment

module

Manage structured modules under <package>/plugins:

fx module add cli users .
fx module add db audit .
fx module list .

Validation:

  • action must be add or list
  • add type must be cli or db
  • module name is normalized to a valid identifier

plugin

Create alias links to importable plugin packages:

fx plugin make math math_ops .
fx plugin link my_package.tools .
fx plugin list .

Notes:

  • link is an alias for make
  • alias defaults to the last package segment if omitted

run

Run the project entrypoint:

fx run .
fx run . --host 0.0.0.0 --port 9000 --reload

Behavior:

  • CLI projects run python -m <package>
  • DB projects run python -m uvicorn <package>.api:app

install

Editable install in current/selected environment:

fx install .
fx install . --extras dev
fx install . --extras dev,docs
fx install . --venv-path .venv

update

Update runtime dependencies from pypi, git, or path:

fx update .
fx update . --source git --repo https://github.com/nexustech101/registers.git --ref main
fx update . --source path --path ../registers
fx update . --package registers

Validation rules:

  • source=pypi rejects --repo and --path
  • source=git requires --repo and rejects --path
  • source=path requires --path and rejects --repo

pull

Sync plugins from a Git repository/local checkout:

fx pull https://github.com/org/plugins-repo.git . --ref main --subdir plugins
fx pull ../local-plugins-repo . --force

pull import-validates copied plugins and fails if imports are broken.

health

Run structure and import checks:

fx health .

Alias: fx --doctor .

history

Inspect operation history from .fx/fx.db:

fx history
fx history 50 .

cron

Command shape:

fx cron <action> [subject] [root] [--workers] [--foreground] [--target] [--payload] [--workflow-file] [--job] [--command] [--metadata]

Actions:

  • workspace prepares directories/files for cron workflows
  • jobs discovers/syncs jobs and lists current registrations
  • start / stop / status manage runtime daemon state
  • trigger queues a manual event for a job
  • generate / apply generate and apply deployment artifacts
  • register registers named workflows
  • workflows lists registered workflows
  • run-workflow executes a registered workflow

Common flow:

fx cron workspace .
fx cron jobs .
fx cron start . --workers 4
fx cron status .
fx cron trigger nightly-build . --payload '{"env":"prod"}'

Workflow flow:

fx cron register deploy-workflow . --workflow-file ops/workflows/ci/deploy-workflow.yml --job nightly-build --target github_actions
fx cron workflows .
fx cron run-workflow deploy-workflow . --payload '{"env":"prod"}'

Registration rules:

  • register requires --workflow-file
  • choose one execution mode: --job or --command (not both)

version

fx version
fx --version
fx -V

Programmatic API

fx can be imported for automation:

from fx import run, get_registry, __version__

result = run(["status", "."], print_result=False)
print(result)

registry = get_registry()
print(registry.list_commands())
print(__version__)

Operational Notes

  • fx writes control-plane/project metadata to .fx/fx.db per project root.
  • Command failures raise command errors via registers.cli; run with --help and help <command> to validate argument shape.
  • If cron job discovery does not detect root-level app/ jobs in your runtime, mirror/import jobs under src/app as a compatibility workaround.

Additional Documentation

For a deeper, exhaustive guide, see:

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.1.2.tar.gz (27.5 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.1.2-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fx_tool-1.1.2.tar.gz
  • Upload date:
  • Size: 27.5 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.1.2.tar.gz
Algorithm Hash digest
SHA256 3439c1462ccc51a4684a0fb59e7f90d5702b0a1c141db714cecbe57a6127df25
MD5 f68542fb0e43ac67c9e163e7cfe75e95
BLAKE2b-256 13fe6f0a4ed90940c34608ef38c4a0b3cd7290d730399d5852e5e9cfb5283e18

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_tool-1.1.2.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.1.2-py3-none-any.whl.

File metadata

  • Download URL: fx_tool-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 29.9 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bafea9034dade8a0340639ad5244ac90a0619260d22a33f5fb1af665f17c8d66
MD5 59a04544dd73c4c7c3f197c6c5d04f63
BLAKE2b-256 8e90a4668042c4025545501f91fec0528f36bc78d7f4736157561ba1316045f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_tool-1.1.2-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