Package: abstra-cli
Abstra CLICommand Line Interface for Abstra CloudGetting StartedInstallationDownload preferably using pipx:pipxinstallabstra-cliOr using pip:pipinstallabstra-cliAuthenticationYou will need to be authenticated to run most commands.Run command below:abstraloginCredentials are stored at.abstra/credentialspath inside current directory.Alternatively you can set theABSTRA_API_TOKENenvironment variable.Alternatively you can runabstra configure <token>if you already have a token.CRUD CommandsThe general structure of the commands follows the pattern below:abstra<command><resource>[<argument>...][--<optional-argument-name><optional-argument-value>...]The available commands are:listaddupdateremoveplaylogsRemote resources can be:formshooksjobsfilesvarspackagessubdomaindashList resourcesList remote resources on your workspace.abstralistRESOURCE{forms,hooks,jobs,files,vars,packages}Examples:abstralistpackages

abstralistvars

abstralistfiles

abstralistforms

abstralisthooks

abstralistjobsabstralistsubdomain# Saving cloud packages to a requirements.txt fileabstralistpackages>requirements.txt# Saving cloud environment variables to a .env fileabstralistvars>.envAdd resourceAdds remote resources on your workspace.abstraaddRESOURCE[...OPTIONS]The current options for each resource are:forms:--nameor--nor--title: string--path: string--fileor--f: file_path*--codeor--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--restart-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, not both.Examples:abstraaddform--name="my_form"-fmain.py--background'#fffeee'abstraaddform--path=test-ftest.py--enabled=False

abstraaddform--name="Form Name"--code"from hackerforms import * \n\ndisplay('hello_world')"--background'#fffeee'--main-colorred--start-message'start message'--error-message'error-message'--end-message'end message'--start-button-text'start button text'--show-sidebar--allow-restarthooks--nameor--nor--title: string--path: string--fileor--f: file_path*--codeor--c: string*--enabled: boolean--upsert: boolean* Note: set either file or code, but not both.Examples:abstraaddhook--name="test hook"-fmain.py--upsert

abstraaddhook--path=test-ftest.py--enabled=Falsejobs--nameor--nor--title: string--identifieror--idt: string--scheduleor--crontab: string--fileor--f: file_path--codeor--c: string--enabled: boolean--upsert: boolean* Note: set either file or code, but not both.Examples:abstraaddjob--idtnew-job--noenabled--name="Test Job"--upsert

abstraaddjob--idtdaily--schedule="00 00 1 * *"--name="Every midnight"filesfile_path[]: list of file or directory paths. Defaults to.Examples:abstraaddfilesfoo.txtbar.log

abstraaddfilesfoo/./varsenvironment_variable[]: list of Key=Value env vars-f or --file: file_path (ex. -f .env)Examples:abstraaddvarsENVIRONMENT=productionVERSION=1.0.0

abstraaddvars-f.env

abstraaddvars--file.envpackagespackage_name[]: list of packages with optional version (ex. numpy=1.0.1)-f or --file: file_path (ex. --file requirements.txt). Defaults torequirements.txtExamples:abstraaddpackagespandasnumpy=1.0.1scipy>=1.0.1

abstraaddpackages-frequirements.txt

abstraaddpackages-rrequirements.txt

abstraaddpackages--filerequirements.txt

abstraaddpackages--requirementrequirements.txtUpdate resourceUpdates remote resources on your workspace.Currently only available for forms, hooks and jobsabstraupdate[IDENTIFIERORPATH][...OPTIONS]The options for each resource are:formsform_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--restart-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: stringExamples:abstraupdateformnew-onboarding--name="Another name"--allow-restartjobs:identifier: string (required parameter)--nameor--nor--title: string--identifieror--idt: string--scheduleor--crontab: string--fileor--f: file_path--codeor--c: string--enabled: booleanExample:abstraupdatejobdaily--schedule="00 00 5 * *"hookshook_path: string (required parameter)--nameor--nor--title: string--path: string--fileor--f: file_path--codeor--c: string--enabled: booleanExamples:abstraupdatehookstripe-callback--enabledsubdomain--name: string (required parameter)Examples:abstraupdatesubdomainnew-subdomain-nameRemove resourceRemove remote resources from your workspace.abstraremoveRESOURCE[...OPTIONS]Examples:abstraremoveformsales-onboarding

abstraremovejobmonthly

abstraremovehookstripe-test

abstraremovefilesfoo.txtbar.log

abstraremovevarsENVIRONMENTVERSION

abstraremovepackagespandasnumpyscipyPlay resourceRun the resource on Abstra Cloud.Currently only available for forms.abstraplayRESOURCE[...OPTIONS]Examples:abstraplayformb2b-ingestionDeploy CommandThis command allows you to specify several resources in a JSON file and deploy them in one command (great for CI/CD workflows).The default path isabstra.jsonin the root directory.abstradeploy[--fileor-f]Examples:abstradeploy-fprod.jsonThe file shoud follow a structure similar to what you can pass in each resource add command (using deploy the upsert flag will be added).Example file:{"forms":[{"name":"Main Form","path":"main","file":"forms/main.py"},{"name":"Secondary Form","path":"secondary","code":"forms/secondary.py","enabled":false}],"hooks":[{"name":"Test","path":"test","file":"hooks/test.py"},{"name":"Stripe","path":"stripe","file":"hooks/stripe.py"}],"jobs":[{"name":"Monthly","idt":"month","file":"jobs/month.py","schedule":"00 00 1 * *","enabled":false},{"name":"Weekly","idt":"week","file":"jobs/week.py","schedule":"00 00 * * 1"}],"files":["root.json","files/"],"packages":{"file":"requirements.txt"},"vars":{"file":".env"}}For packages and vars you can also specify manually:{"packages":["pydash","stripe==1.1.0"],"vars":["ABSTRA_CLOUD=test","STRIPE_KEY=foobar"]}Logs CommandThis command allows you to see the logs of one resource in your workspace.abstralogsRESOURCE[...OPTIONS]The options for each resource are:dash--path: string (optional)--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)Examples:abstralogsdash--pathmy-dash--limit10--offset0form--id: string (optional)--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogsform--limit10--offset0hooksIt lists all the logs in your workspace.--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogshooks--limit10--offset0hook--idor--log_id: string--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogshook--id6a7788c1-7eaf-46a6-93d5-13dfba962e90--limit10--offset0jobsIt lists all the logs in your workspace.--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogsjobs--limit10--offset0jobIt lists all the logs within a specific job or a specific log.--idor--log_id: string--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogsjob--id6a7788c1-7eaf-46a6-93d5-13dfba962e90--limit10--offset0workspaceIt lists the logs of all resources in your workspace.--limit: integer (optional, default to 20. To disable set to 0)--offset: integer (optional, default to 0)abstralogsworkspaceAliasesSome commands have aliases.upload# Alias for `abstra add files` with default argument `.`abstraupload[FILESorDIRECTORIES,default:.]ls# Alias for `abstra list files`abstralsrm# Alias for `abstra remove files`abstrarminstall# Alias for `abstra add packages`abstrainstall[PACKAGES]Ignoring filesYou can ignore files placing a text file named.abstraignoreat the target directory. The file.abstraignoreitself will always be ignored.Example:__pycache__

tests/

*.ipynb