Source Command
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide documents the source
command in the Kubiya CLI, which allows you to manage sources of tools in your Kubiya environment. Sources are repositories that contain tools that can be used by your teammates.
Want to know more about Sources in Kubiya? Learn more about Sources
The source
command (aliased as sources
) provides comprehensive management of tool sources. Sources are typically Git repositories or inline definitions that contain the tools your AI teammates can use to perform tasks.
View all sources in your environment:
Scan a Git repository or local directory to discover tools:
Get detailed information about a specific source:
Add a new source from a Git repository or as inline tools:
For more details on adding sources via the web UI, see Add a Source
Load a source temporarily without creating it permanently. This is useful for testing tools before adding them as a permanent source:
The load
command creates a temporary source that won't be saved permanently. This is useful for testing tools or running one-off operations.
Modify an existing source:
Synchronize a source to get the latest tools:
For more details on syncing sources via the web UI, see Sync a Source
Remove a source:
For more details on deleting sources via the web UI, see Delete a Source
Debug source-related issues:
These options are available for all source commands:
--runner
, -r
Runner name to use for operations
--output
, -o
Output format (text|json)
--full
Show detailed information for each source
--debug
Enable debug logging
--name
, -n
Source name
--config
, -c
Path to dynamic configuration file (JSON)
--yes
Skip confirmation prompts
--inline
File containing inline tool definitions (YAML or JSON)
--inline-stdin
Read inline tool definitions from stdin
--runner
Runner name for the source
--name
, -n
New source name
--config
, -c
Path to dynamic configuration file (JSON)
--yes
Skip confirmation prompts
--inline
File containing inline tool definitions (YAML or JSON)
--inline-stdin
Read inline tool definitions from stdin
--runner
Runner name for the source
--mode
, -m
Sync mode (interactive|non-interactive|ci)
--branch
, -b
Branch to sync
--force
, -f
Force sync
--auto-commit
Automatically commit changes
--interactive
Enable interactive mode
--output
Output format (text|json)
--config
Path to dynamic configuration file (JSON)
--local
Scan local directory instead of remote URL
--repo
Repository URL to scan
--branch
Branch to scan
--path
Relative path within repository
--remote
Git remote name (default: origin)
--force
Force scan even with uncommitted changes
--add
Stage changes after scan (can specify patterns)
--push
Push changes after scan
--commit-msg
Commit message for changes
--runner
Runner name for source
Git sources are repositories that contain tool definitions in specific formats. The Kubiya CLI can scan these repositories to discover tools and make them available to your teammates.
Inline sources contain tool definitions that are provided directly rather than from a Git repository. Inline sources can be provided in two ways:
You can provide tool definitions directly through JSON or YAML files:
Example tools.yaml format:
You can also upload Python files or entire directories as inline sources. The CLI will automatically zip the content and upload it:
When adding a directory, the CLI will:
Automatically detect if it's a Python project
Include only relevant Python files and project files if it's a Python project
Exclude hidden files and directories
Create a zip file and upload it to the Kubiya API
When uploading Python code, your Python files must declare at least one tool using the Kubiya SDK. See Build a Tool using Kubiya SDK for details on how to create tools with the SDK.
This is particularly useful for tools that require multiple files or dependencies.
The CLI includes special handling for Python projects. When you add a Python file or directory as an inline source, the system will:
Detect Python Projects: The CLI automatically identifies directories as Python projects if they contain:
Python-specific files like setup.py
, requirements.txt
, pyproject.toml
At least 3 Python (.py
) files
Module structure with __init__.py
files
Smart Filtering: For identified Python projects, the system only includes:
Python source files (.py
, .pyi
, .pyx
, .pxd
)
Python project files (requirements.txt
, setup.py
, etc.)
Configuration files (.yaml
, .yml
, .json
)
Documentation files (README.md
, LICENSE
, etc.)
Exclusions: The system automatically excludes:
Hidden files and directories (starting with .
)
Compiled Python files (.pyc
, __pycache__
)
Non-essential directories and files
This intelligent handling ensures that only relevant files are included in your tools, keeping them lightweight and focused.
Kubiya SDK Integration: Your Python code must define at least one tool using the Kubiya SDK. Here's a simple example:
For more complex tools and to use the full capabilities of the SDK, initialize your project with:
The kubiya init
command creates template tools and the necessary directory structure, while kubiya bundle
runs the discovery process locally to validate your tools before uploading.
For full documentation on using the Kubiya SDK, see Build a Tool using Kubiya SDK.
After adding sources, you can list, search, and describe the tools they contain:
Sources can be managed through CI/CD pipelines:
You can also manage sources through Terraform using the Kubiya provider:
For more details on managing sources with Terraform, see Sources in Terraform
Source Not Found
Verify the UUID is correct
Check if the source exists with kubiya source list
Verify your API key has access to the source
Sync Failures
Ensure the repository is accessible
Check if there are conflicts in the repository
Verify you have the correct permissions
Tool Discovery Issues
Ensure tools are defined in the correct format
Verify the source contains valid tool definitions
Use kubiya source debug
to get more information
kubiya tool list
- List tools from sources
kubiya tool search
- Search for tools across sources
kubiya tool describe
- Show detailed information about a tool
kubiya generate-tool
- Generate a new tool
Sources Overview - Learn more about sources in Kubiya
Add a Source - How to add a source via the web UI
Connect a Source to a Teammate - How to give teammates access to tools in a source
Terraform Provider - Managing sources with Terraform
The source
command in Kubiya CLI is essential for managing the tools available to your AI teammates. By properly managing sources, you can provide your teammates with the capabilities they need to perform tasks effectively.