Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 56 lines (32 sloc) 3.18 KB

⚠️ Legacy, not maintained anymore. Check any2api.org for recent developments. ⚠️


Command-Line Interface (CLI)

First, you need to install any2api-cli to make the any2api command available on your machine. Alternatively, you can use a Docker container or Vagrant VM to run any2api-cli in an isolated environment. Either way any2api expects a command and (optionally) an arbitrary number of options:

any2api [options...] <command>

The available options and commands are shown in the following.

Commands

  • install <type> <modules...> Install given module(s) of the specified type (scanner, invoker, generator). A module is specified by its name (public npm module name), a directory path, or a URL.
  • update <type> <modules...> Update given module(s) of the specified type (scanner, invoker, generator). A module is specified by its name.
  • uninstall <type> <modules...> Uninstall given module(s) of the specified type (scanner, invoker, generator). A module is specified by its name.
  • scan <executables...> Scan given executable(s) to produce an API spec. An executable is specified by a file path, a directory path, or a URL.
  • gen <apispec> Generate an API implementation for the given API spec. The API spec is specified by a file path or a directory path (containing an apispec.json file).

Options

  • -h, --help Show usage information.
  • -V, --version Show version number.
  • -o, --output <dir> Set output directory for the artifacts produced by a command (e.g., generated API spec, generated API implementation).
  • -S, --scanner <name> Select scanner by name to analyze given executable(s) with the scan command.
  • -r, --retrieve <protocol> Select protocol (e.g., http, git, bazaar) to retrieve executables specified by URL.
  • -c, --copy Copy executable(s) to output directory, even in case they are already stored in the local filesystem.
  • -G, --generator <name> Select generator by name to build an API implementation with the gen command.
  • -s, --skip-prepare Skip preparing executables (e.g., downloading and packaging dependencies) when building an API implementation.
  • -i, --interface <interface> Select kind of interface (e.g., rest).
  • -t, --impl-type <type> Select type of API implementation (e.g., node).
  • --impl-title <title> Set title for API implementation.

Examples

Install all available scanner modules:

any2api install scanner all

Install specific invoker module:

any2api install invoker any2api-invoker-python

Update all available invoker modules:

any2api update invoker all

See Getting started for more examples.