Command Line Reference¶
harp¶
HTTP Application Runtime Proxy (HARP)
The following commands are available to help you setup and run your HTTP proxy application.
harp [OPTIONS] COMMAND [ARGS]...
config¶
Compiles and dumps the current configuration, the same way that “server” commands would do it.
Example:
$ harp config –file … –example … –set … –endpoint …
harp config [OPTIONS]
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
- --raw¶
Prints the raw configuration as a dictionary.
- --json¶
Prints the raw configuration as JSON.
- --unsecure¶
Prints the configuration without hiding sensitive information.
create¶
Creates a new project using cookiecutter.
harp create [OPTIONS] {project}
Arguments
- TEMPLATE¶
Required argument
db:create-migration¶
harp db:create-migration [OPTIONS] MESSAGE
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
Arguments
- MESSAGE¶
Required argument
db:feature¶
harp db:feature [OPTIONS] {add|remove} [FEATURES]...
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
Arguments
- OPERATION¶
Required argument
- FEATURES¶
Optional argument(s)
db:history¶
harp db:history [OPTIONS]
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
db:merge¶
harp db:merge [OPTIONS] MESSAGE [REVISIONS]...
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
Arguments
- MESSAGE¶
Required argument
- REVISIONS¶
Optional argument(s)
db:migrate¶
harp db:migrate [OPTIONS] {up|down} REVISION
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
- --reset¶
Reset the database (drop all before migrations).
Arguments
- OPERATION¶
Required argument
- REVISION¶
Required argument
db:reset¶
harp db:reset [OPTIONS]
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
examples¶
Examples related commands.
harp examples [OPTIONS] COMMAND [ARGS]...
list¶
List available examples.
harp examples list [OPTIONS]
Options
- --raw¶
Simple output without any decoration.
install-dev¶
Installs the development dependencies.
harp install-dev [OPTIONS]
rules¶
Rules engine related commands.
harp rules [OPTIONS] COMMAND [ARGS]...
lint¶
Lint the rules.
harp rules lint [OPTIONS]
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
run¶
harp rules run [OPTIONS] ENDPOINT METHOD PATH
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
Arguments
- ENDPOINT¶
Required argument
- METHOD¶
Required argument
- PATH¶
Required argument
server¶
Starts HARP server, using the provided configuration. This is the main process and will be the only process you need on a live server, it will serve both the proxy ports and the compiled frontend assets (dashboard).
harp server [OPTIONS]
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
start¶
Starts the local development environment, using honcho to spawn a configurable set of processes that you
can adapt to your needs. By default, it will starts the dashboard (frontend dev server) and server (python
server) processes. For live instances, you’ll prefer harp server
.
harp start [OPTIONS] [SERVICES]...
Options
- -f, --file <files>¶
Load configuration from file (configuration format will be detected from file extension, can be used multiple times).
- --example <examples>¶
Load configuration from example (can be used multiple times).
- --set <options>¶
Add configuration options (e.g.
--set foo=bar
or--set foo bar
, can be used multiple times).
- --endpoint <endpoints>¶
Add an endpoint (e.g.
--endpoint httpbin=4000:http://httpbin.org/
, can be used multiple times).
- --applications <applications>¶
List of applications to enable.
- --enable <enable>¶
Enable some applications.
- --disable <disable>¶
Disable some applications.
- --with-docs, --no-docs¶
Append the sphinx doc process to the process list.
- --with-ui, --no-ui¶
Append the storybook process to the process list.
- --mock¶
Enable mock data instead of real api data (dashboard only).
- -XS, --server-subprocess <NAME:PORT:CMD>¶
Add a server subprocess to the list of services to start (experimental, can be used multiple times).
Arguments
- SERVICES¶
Optional argument(s)
version¶
Show HARP version.
harp version [OPTIONS]
How to use¶
For PIP and source installs, it will be available as harp in your python environment.
For source installations, you may need to use poetry run harp ….
Docker¶
For Docker installs, the harp CLI being the default command of the container you can pass arguments to the docker run command directly.
docker run -it --rm \
makersquad/harp-proxy \
server --endpoint httpbin=4000:https://httpbin.org
Python package¶
For regular python installations (for example, using pip to install it from PyPI), you’ll find the harp command in your python environment’s path, thus you’ll be able to run:
harp server --endpoint httpbin=4000:https://httpbin.org
Sources¶
For sources installations, the behaviour is similar to installing it from a packaged wheel (python package), but you may need to force using the right environment using poetry.
poetry run harp server --endpoint httpbin=4000:https://httpbin.org
Another way would be to activate the poetry environment and run the command directly:
poetry shell
harp server --endpoint httpbin=4000:https://httpbin.org