artax-cli
v7.3.7
Published
CLI for Interactive Strategies
Readme
Artax CLI
CLI for Interactive Strategies. Create and scaffold projects (Static HTML, WordPress, Drupal) and generate components, pages, mixins, and more from the terminal.
Requirements
- Node.js
^20(Volta users:volta install node@20)
Installation
Install globally so the artax-cli command is available everywhere:
npm install -gOr from the repo root:
npm linkUsage
artax-cli new (or artax-cli n)
Create a new project from a boilerplate. Runs an interactive prompt to choose:
- Project type: Static HTML, WordPress, or Drupal (D10 or D11; Note that Drupal 10 is EoL; use Drupal 11 for new projects)
- Project name (must be a valid npm package name)
- Description
- Domain (WordPress only): e.g.
website.com→local.website.com - Boilerplate branch (when the type has multiple branches; for Drupal, choose Drupal 10 or Drupal 11)
The command clones the configured repo, removes its git history, inits a new repo, writes a .artaxrc in the project root, and customizes package.json (and similar) with the project name and description.
artax-cli new
# or
artax-cli nartax-cli generate [type] <name> (or artax g)
Generate files inside an existing Artax project. Must be run from the project root (a directory that contains .artaxrc).
Syntax:
artax-cli generate <generator-type> <name> [options]
# or
artax-cli g <generator-type> <name> [options]Options:
--js— When generating a component (or block), also create a JS partial.
Generator types and <name> depend on project type:
| Project type | Generator types | Example |
|----------------|------------------------------------------|---------|
| Static HTML| component, page, mixin (SCSS), function (SCSS), is-search | artax g component hero or artax g is-search blog-search |
| Drupal | component, page, mixin (SCSS), function (SCSS) | artax g page about |
| WordPress | component, block, page, template, mixin, function | artax g block cta --js |
Examples:
# From a Static HTML project root
artax-cli generate component hero --js
artax-cli generate page about
artax-cli generate mixin breakpoint
artax-cli generate function strip-unit
artax-cli generate is-search product
# From a WordPress project root
artax-cli g block call-to-action --js
artax-cli g template landingartax-cli s3
Create an S3 bucket for a Static HTML site via AWS CloudFormation. Uses the API at api.html.interactive-strategies.com and the project name from .artaxrc. Must be run from the project root.
artax-cli s3Other commands
artax-cli --version # Show version
artax-cli --help # Show helpProject detection
Commands that operate on an existing project (generate, s3) look for a .artaxrc file in the current working directory. That file is created when you run artax-cli new and stores:
projectType— e.g."Static HTML","WordPress","Drupal"projectName— name given at creation
If .artaxrc is missing, those commands exit with an error telling you to run them from the root of an Artax project.
Repository
- Artax CLI:
[email protected]:interactivestrategies/artax-cli.git - Boilerplate repos and branches are defined in
package.jsonunderconfig(e.g.config.staticHtml,config.wordpress,config.drupal).
License
MIT
