the AskAnna CLI page you can read how to install it. Or quickly do it by running the next commands in your Python environment:
pip install askanna
And ones installed, you can log in by running:
We assume you have an AskAnna account and that you logged in. On the workspace overview, you can quickly create a project via the button
Create project. You only have to add a name, and you can create the new project. After you created the new project, you can open it.
With the AskAnna CLI you can create the project by running:
askanna create "Hello AskAnna"
This will create a project in AskAnna. Also, it will create a new local directory
hello-askanna with a file askanna.yml.
If in step 1 you created the project via the web interface, then you should now first create a local directory for your project. When you created the project via the CLI, then you should already have a directory
In this directory you can add a Python file with a script. For example:
Save this Python script as
Also for this step you can use your terminal:
echo 'print("Hello, AskAnna!")' > hello.py
If in step 1 you created the project via the AskAnna CLI, then you already have a
askanna.yml file in your local directory. When you created the project via the web interface then first add a file
askanna.yml in your local directory.
Let's define a job
hello that can run the hello-script, by adding the next lines to your
askanna.yml config file:
hello: job: - python hello.py
If you created the project via the CLI, then your
askanna.yml file should now contain the push-target and the definition of the job. The push-target does not have to be set, but if you want to try out the push method in the next step then you need to add the push-target to the
askanna.yml file. On the project page you can copy this info. See the green circle where you can find this information:
You can use the web interface of AskAnna to upload a ZIP file.
Add your local files
askanna.yml to a ZIP archive:
Send toand then select
Compressend (zipped) folder
To upload the ZIP file, open the project in AskAnna. If you open the project in the web interface you will see something like this:
You can drag & drop the ZIP file to the dotted area, or click on browse and select the ZIP archive from there. Confirm that you want to upload the file, and AskAnna will do the rest. Probably in a second you can open the code in the web interface.
In the directory where you build the "Hello AskAnna" project, you can run the command to push your code to AskAnna:
Now the AskAnna CLI will package your code and upload this to AskAnna. After the push (or upload) is finished, you can open your project in AskAnna. Now you should see two files. Feel free to click on a file to check the content.
If you now click on the
JOBS section, you will see the job
Click on the job to open the job page. On this page you find a section
Running the job. First let's run the job via the platform. You can do this by clicking on
RUN THIS JOB:
Now you can click on
OPEN THE RUN to open the run page. On this page you can find meta information about the run. When the run finished, you can open the
LOG section and verify that AskAnna run your code:
You can also use the AskAnna CLI to run the job. If you are still in the project directory you can simply run:
askanna run hello
When you are working on a project, you probably update your scripts and want to run a job on the latest version. With the AskAnna CLI you can do this with one single command that combine step 4.2 and step 5:
askanna run hello --push
You now have successfully: