Abstra CLI
Reason this release was yanked:
Deprecated
Project description
abstra-cli
Install
Download from pip (preferably using pipx):
pip[x] install abstra-cli
Commands
Most commands are authenticated. To authenticate you need to generate an API Token here.
Authentication credentials are stored in the current directory at .abstra/credentials
.
Alternatively you can set the ABSTRA_API_TOKEN
environment variable.
Configure
abstra configure [API_TOKEN]
It configures the current working directory credentials. Credentials are stored at .abstra/credentials
.
Ignoring files
You can ignore files placing a .abstraignore
at the target directory:
__pycache__
tests/
*.ipynb
.abstraignore
itself will always be ignored
Remote resources
The general structure of the commands follows the pattern below: usage: abstra <command> <resource> [<argument>...] [--<optional-argument-name> <optional-argument-value> ...]
The available commands are: list, add, update*, remove and play*.
*note: update and play commands are currently only available for forms and hooks .
Remote resources can be forms
, hooks
, jobs
, files
, vars
or packages
.
You can manage remote resources with the following commands:
List resources
abstra list RESOURCE{forms, hooks, jobs, files, vars, packages}
List remote resources on your workspace.
Examples:
abstra list packages
abstra list vars
abstra list files
abstra list forms
abstra list hooks
abstra list jobs
# Saving env vars and packages
abstra list packages > requirements.txt
abstra list vars > .env
Add resource
abstra add RESOURCE [...OPTIONS]
Adds remote resources on your workspace.
The current options for each resource are:
- forms:
--name
or--n
or--title
: string--path
: string--file
or--f
: file_path--code
or--c
: string--enabled
: boolean--background
: image_path or string--main-color
: string--start-message
: string--error-message
: string--end-message
: string--start-button-text
: string--timeout-message
: string--logo-url
: string--show-sidebar
: boolean--log-messages
: boolean--font-color
: string--auto-start
: boolean--allow-restart
: boolean--welcome-title
: string--brand-name
: string--upsert
: boolean
*note: set either file or code, but not both.
- hooks:
--name
or--n
or--title
: string--path
: string--file
or--f
: file_path--code
or--c
: string--enabled
: boolean--upsert
: boolean
*note: set either file or code, but not both.
- jobs:
--name
or--n
or--title
: string--identifier
or--idt
: string--schedule
or--crontab
: string--file
or--f
: file_path--code
or--c
: string--enabled
: boolean--upsert
: boolean
*note: set either file or code, but not both.
-
files:
- file_path[]: list of file or directory paths
-
vars:
- environment_variable[]: list of Key=Value env vars
- -f or --file: file_path (ex. -f .env)
-
packages:
- package_name[]: list of packages with optional version (ex. numpy=1.0.1)
- -f or --file: file_path (ex. --file requirements.txt)
Examples:
# Files
abstra add files foo.txt bar.log
abstra add files foo/ ./
# Vars
abstra add vars ENVIROMENT=production VERSION=1.0.0
abstra add vars -f .env
abstra add vars --file .env
# Packages
abstra add packages pandas numpy=1.0.1 scipy>=1.0.1
abstra add packages -f requirements.txt
abstra add packages -r requirements.txt
abstra add packages --file requirements.txt
abstra add packages --requirement requirements.txt
# forms
abstra add form --name="my_form" -f main.py --background '#fffeee'
abstra add form --path=test -f test.py --enabled=False
abstra add form --name="Form Name" --code "from hackerforms import * \n\ndisplay('hello_world')" --background '#fffeee' --main-color red --start-message 'start message' --error-message 'error-message' --end-message 'end message' --start-button-text 'start button text' --show-sidebar --allow-restart
# hooks
abstra add hook --name="test hook" -f main.py --upsert
abstra add hook --path=test -f test.py --enabled=False
# jobs
abstra ad job --idt new-job --noenabled --name="Test Job" --upsert
abstra ad job --idt daily --schedule="00 00 00 * *" --name="Every midnight"
Update resource
currently only available for forms, hooks and jobs
```sh
abstra update [IDENTIFIER OR PATH] [...OPTIONS]
Updates remote resources on your workspace.
The current options for each resource are:
-
forms:
form_path
: string (required parameter)--name
: string--path
: string--file
: file_path--code
: string--enabled
: boolean--background
: image_path or string--main-color
: string--start-message
: string--error-message
: string--end-message
: string--start-button-text
: string--timeout-message
: string--logo-url
: string--show-sidebar
: boolean--log-messages
: boolean--font-color
: string--auto-start
: boolean--allow-restart
: boolean--welcome-title
: string--brand-name
: string
-
hooks:
hook_path
: string (required parameter)--name
or--n
or--title
: string--path
: string--file
or--f
: file_path--code
or--c
: string--enabled
: boolean
-
jobs:
identifier
: string (required parameter)--name
or--n
or--title
: string--identifier
or--idt
: string--schedule
or--crontab
: string--file
or--f
: file_path--code
or--c
: string--enabled
: boolean
Examples:
# Forms
abstra update form new-onboarding --name="Another name" --allow-restart
abstra update hook stripe-callback --enabled
abstra update job daily --schedule="00 00 5 * *"
Remove resource
abstra remove RESOURCE [...OPTIONS]
Remove remote resources from your workspace.
Examples:
abstra remove files foo.txt bar.log
abstra remove vars ENVIROMENT VERSION
abstra remove packages pandas numpy scipy
abstra remove form sales-onboarding
abstra remove hook stripe-test
abstra remove job monthly
Play resource
abstra play form b2b-ingestion
abstra play hook hasura-callback --method POST
Aliases
Some commands have aliases.
upload
# Alias for `abstra add files` with default argument `.`
abstra upload [FILES or DIRECTORIES, default: .]
ls
# Alias for `abstra list files`
abstra ls
rm
# Alias for `abstra remove files`
abstra rm
install
# Alias for `abstra add packages`
abstra install [PACKAGES]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for abstra_cli-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a34fe7f2efc6610187a17874edaaf79f0c7bf021442016d327a9c3eaec3897 |
|
MD5 | 98a3df13b651dc218bb3d746a8038427 |
|
BLAKE2b-256 | 9c2dd321796690c83c98f0981c18fe5cfdabc4f5304f7b7b461f06ddf285540b |