Source Management
Initializing Local Source Code
If you created your function using the --auto-create flag, or if the function already contains source code in the registry, you should start by downloading the code to your local machine.
Downloading Code
The download command fetches the function’s source code and places it into a specified directory.
fathom intelligence function download <FUNCTION_ID> <DIRECTORY>
Example
To download a function to a folder named testing:
fathom intelligence function download --id 44b18587-5eb1-4261-a90e-fa6852bc8086 testing
After downloading, your directory (e.g., testing) will typically look like this:
testing
├── func.yaml # Function configuration
├── function/ # Source code directory
│ ├── __init__.py
│ └── func.py # Main logic
├── pyproject.toml # Dependency management
├── README.md
└── tests/ # Local tests directory
└── test_func.py
Uploading Changes
Once you have made changes to your logic or updated the dependencies locally, you must upload the source code back to the platform before it can be built or deployed.
fathom intelligence function upload <FUNCTION_ID> <DIRECTORY>
Usage Note:
- The
argument should point to the root folder containing your func.yaml or main source files. - This command updates the “Source” state of the function on the platform, but it does not automatically trigger a new deployment. You must run a build and deploy command separately to see the changes live.
Versioning and Revisions
Every time you successfully upload code, the CLI generates a new Revision ID. This ID is used to track different versions of your source code before they are built.
fathom intelligence function upload --id 44b18587-5eb1-4261-a90e-fa6852bc8086 testing
Function source code updated - revision: v1
Next Step
Now that your source code is synchronized with the platform, you are ready to compile your code and push it to a live environment.
Proceed to Build and Deploy to learn how to finalize your function.