Skip to content
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

Clean up CLI #26

Open
eaton opened this issue Nov 28, 2022 · 2 comments
Open

Clean up CLI #26

eaton opened this issue Nov 28, 2022 · 2 comments

Comments

@eaton
Copy link
Contributor

eaton commented Nov 28, 2022

Right now, the core Spidergram project implements a base Command class and a number of example commands. Long term (see the Monorepo task) we want to split the example commands into a separate project to avoid confusion with custom crawl/process/etc commands added by Spidergram-consuming projects.

When we do that, it'd be useful to give the base SgCommand class some internal flags to control output state (verbose, interactive, silent, etc); its helper functions could rely on those flags to control how progress/results are displayed, and child classes wouldn't have to reimplement all the check logic — just set the class property after parsing their own flags.

@eaton eaton added this to Spidergram Nov 28, 2022
@eaton
Copy link
Contributor Author

eaton commented Mar 9, 2023

This is currently in progress:

  1. Splitting some of our helper code out of the Oclif-dependent command classes, is now complete.
  2. Moving more internal behavioral control to configuration is now complete, allowing CLI tools and custom scripts to share more settings.
  3. Still TODO? Tidying the project and db commands now that the configuration system is better organized. Also, reworking the crawl and report commands to use the new config

@eaton
Copy link
Contributor Author

eaton commented Mar 20, 2023

Over the course of the 0.9.0 release we've ironed out a rough plan for the public-facing CLI interface.

  • spidergram (lists available commands)
    • spidergram status (contextual info: current config file, db availability, number of records)
    • spidergram setup (prompt-driven creation of a new config file in the current directory)
    • spidergram inspect (do full extraction from a single URL without touching the DB; tests config)
    • spidergram crawl (crawl 1-n urls with current config)
    • spidergram process (run analysis functions on all resources with current config)
    • spidergram query (ad-hoc or predefined queries, with optional export to files)
    • spidergram report (generate a pre-defined report from current config)
    • spidergram go (crawl, then process, then report using current config)

There may be additional utility commands — sitemap grabbing, database compacting, and url tree generation are two examples of "misc" commands currently in the spidergram CLI — but the set of commands above is critical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant