Our CLI is a bit of a mess right now. There are many flags that all do different things, some of which have conflicting behavior. It is not clear which flags you should use when, or even what all of the flags are.
╭─ Before ─────────────────────────────────────────────┬─ After ─────────────────────────────╮
│ npm run start │ agtern run frontend │
│ npm run update-api-client │ agtern sync api │
│ python -m backend │ agtern run backend --production │
│ python -m backend --dev │ agtern run backend │
│ python -m backend --dev --no-scrape │ agtern run api │
│ python -m backend --dev --scrape-only │ agtern run scraper │
│ python -m backend --dev --save-jobs │ agtern run backend │
│ python -m backend --dev --show-scraper --save-jobs │ agtern run backend --show-scraper │
╰──────────────────────────────────────────────────────┴─────────────────────────────────────╯
╭─ Other Options ──────────────────────────────────────┬─────────────────────────────────────╮
│ --(in/ex)clude-companies --run-as-proc │ --timeout=5 --max-jobs=3 │
╰──────────────────────────────────────────────────────┴─────────────────────────────────────╯
Other possible features:
agtern build / agtern build scraper: Build Docker images for the API server or the web scraper
agtern backup database / agtern restore database: Backup/restore a PostgreSQL database from a SQLite database file
agtern run scrape amazon google tesla --timeout=5 --max-jobs=3 --crawl-delay=1 --print-result --print-tracebacks: Utilize all of the features of ScrapeSettings
For the best developer experience, these commands should have useful error messages and help output. This can be achieved easily using the Typer library, a library written by the maintainer of FastAPI that is advertised as the FastAPI of CLIs. Typer also features automatic shell autocompletion of CLI parameters and pretty formatting.
Our CLI is a bit of a mess right now. There are many flags that all do different things, some of which have conflicting behavior. It is not clear which flags you should use when, or even what all of the flags are.
Other possible features:
agtern build / agtern build scraper
: Build Docker images for the API server or the web scraperagtern backup database / agtern restore database
: Backup/restore a PostgreSQL database from a SQLite database fileagtern run scrape amazon google tesla --timeout=5 --max-jobs=3 --crawl-delay=1 --print-result --print-tracebacks
: Utilize all of the features ofScrapeSettings
For the best developer experience, these commands should have useful error messages and help output. This can be achieved easily using the Typer library, a library written by the maintainer of FastAPI that is advertised as the FastAPI of CLIs. Typer also features automatic shell autocompletion of CLI parameters and pretty formatting.