| name | uipath-cli-git |
| tags | ["uipath-dev","cli","git","version-control","source-control"] |
| description | Execute Git operations for UiPath projects using CLI commands. Covers git init, clone, commit, push, pull, branch management, and CI/CD workflows. Aligns with the official uipathcli (studio package analyze, pack, publish, test run). Triggers on requests like "commit UiPath project", "push to git", "clone UiPath repo", "git workflow for UiPath", "analyze project in CI". |
UiPath CLI Git Operations
Execute Git operations for UiPath automation projects using command-line interface.
When to Use
- "Commit UiPath project changes"
- "Push workflow to repository"
- "Clone UiPath project from Git"
- "Create branch for feature"
- "Set up Git for UiPath project"
- "CI/CD pipeline for UiPath"
- "Analyze UiPath project in GitHub Actions" / "governance check before merge"
Quick Reference
UiPath CLI (uipathcli) with Git
Official CLI: github.com/UiPath/uipathcli. Use from the project root (project.json).
| Command | Purpose |
|---|
uipath studio package analyze | Governance / static analysis (policy violations, warnings) |
uipath studio package pack | Build .nupkg |
uipath studio package publish | Publish package (Orchestrator / feed per your setup) |
uipath studio test run | Run Studio test cases via connected Orchestrator |
uipath config | Auth (PAT, OAuth, client credentials) and profiles |
Not the same binary: The uipath installed via Python/pip (UiPath SDK) exposes commands like pack, run, deploy — it does not implement studio package analyze. For Studio XAML projects, install uipathcli from GitHub releases and ensure uipath.exe on PATH is that build. Close Studio (or the project) before running studio package analyze; otherwise the analyzer reports a database lock (“project is already opened in another Studio instance”).
Review: combine analyze (automated rules) with the uipath-code-reviewer skill for XAML/C# quality. See UiPath CLI Reference.
Common Git commands for UiPath
| Command | Purpose |
|---|
git init | Initialize new repository |
git clone | Clone existing repository |
git add | Stage changes |
git commit | Commit staged changes |
git push | Push to remote |
git pull | Pull from remote |
git branch | Manage branches |
git checkout | Switch branches |
git merge | Merge branches |
git status | Check repository status |
UiPath-Specific Files
| File/Folder | Git Action |
|---|
*.xaml | Track (workflow files) |
project.json | Track (project config) |
.objects/ | Track (Object Repository) |
.local/ | Ignore (local settings) |
.screenshots/ | Ignore (debug screenshots) |
*.nupkg | Ignore (packages) |
Project Setup
Initialize Git for UiPath Project
cd "C:\Users\Username\Documents\UiPath\MyProject"
git init
cat > .gitignore << 'EOF'
.local/
.screenshots/
.objects/.local/
*.nupkg
*.zip
bin/
obj/
output/
.vs/
*.user
*.suo
Thumbs.db
.DS_Store
*.log
logs/
*.tmp
*.temp
~$*
.env
*.credentials
EOF
git add .
git commit -m "Initial commit: UiPath project setup"
Clone Existing UiPath Project
git clone https://github.com/org/uipath-project.git
git clone https://dev.azure.com/org/project/_git/uipath-project
git clone -b develop https://github.com/org/uipath-project.git
git clone https://github.com/org/uipath-project.git ./my-local-folder
Configure Git for UiPath Development
git config user.name "Developer Name"
git config user.email "developer@company.com"
git config core.autocrlf true
git config diff.xaml.textconv "cat"
git config init.defaultBranch main
Daily Workflow
Check Status
git status
git status -s
Stage Changes
git add Main.xaml
git add "*.xaml"
git add .
git add -p
git reset HEAD Main.xaml
Commit Changes
git commit -m "Add invoice processing workflow"
git commit -m "Add invoice processing workflow
- Added Main.xaml with invoice extraction logic
- Updated project.json with new dependencies
- Added error handling for invalid invoices"
git commit --amend -m "Updated commit message"
git commit -am "Quick fix for selector issue"
Push to Remote
git push origin main
git push
git push -u origin feature/invoice-processing
git push --force-with-lease origin feature/my-branch
Pull from Remote
git pull
git pull --rebase
git pull origin develop
git fetch origin
Branch Management
Create and Switch Branches
git branch feature/new-workflow
git checkout feature/new-workflow
git checkout -b feature/new-workflow
git checkout -b hotfix/urgent-fix abc1234
git branch -a
git branch -d feature/completed
git push origin --delete feature/completed
Merge Branches
git checkout main
git merge feature/new-workflow
git merge --no-ff feature/new-workflow
git merge --abort
Resolve Merge Conflicts
git status
git add Main.xaml
git commit -m "Merge feature/new-workflow into main"
git mergetool
UiPath-Specific Workflows
Feature Development Workflow
git checkout main
git pull origin main
git checkout -b feature/JIRA-123-invoice-automation
git add .
git commit -m "JIRA-123: Add invoice extraction sequence"
git add .
git commit -m "JIRA-123: Add error handling for missing fields"
git push -u origin feature/JIRA-123-invoice-automation
git checkout main
git pull origin main
git merge --no-ff feature/JIRA-123-invoice-automation
git push origin main
git branch -d feature/JIRA-123-invoice-automation
git push origin --delete feature/JIRA-123-invoice-automation
Hotfix Workflow
git checkout main
git pull origin main
git checkout -b hotfix/critical-selector-fix
git add .
git commit -m "Hotfix: Update selector for changed UI element"
git push -u origin hotfix/critical-selector-fix
git checkout main
git merge --no-ff hotfix/critical-selector-fix
git push origin main
git checkout develop
git merge --no-ff hotfix/critical-selector-fix
git push origin develop
git branch -d hotfix/critical-selector-fix
Release Workflow
git checkout develop
git checkout -b release/1.2.0
git add project.json
git commit -m "Bump version to 1.2.0"
git checkout main
git merge --no-ff release/1.2.0
git tag -a v1.2.0 -m "Release version 1.2.0"
git push origin main --tags
git checkout develop
git merge --no-ff release/1.2.0
git push origin develop
git branch -d release/1.2.0
CI/CD Integration
Use the official uipathcli commands from the repo root. Configure auth with uipath config (PAT, OAuth, or client credentials) or the supported UIPATH_* environment variables—never commit secrets.
GitHub Actions Workflow
name: UiPath CI/CD
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install UiPath CLI (GitHub release)
run: |
Invoke-WebRequest "https://github.com/UiPath/uipathcli/releases/latest/download/uipathcli-windows-amd64.zip" -OutFile "uipathcli.zip"
Expand-Archive -Force -Path "uipathcli.zip" -DestinationPath "$env:RUNNER_TEMP\uipathcli"
echo "$env:RUNNER_TEMP\uipathcli" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Analyze project (governance)
working-directory: ./path/to/StudioProject
env:
UIPATH_PAT: ${{ secrets.UIPATH_PAT }}
UIPATH_ORGANIZATION: ${{ secrets.UIPATH_ORGANIZATION }}
UIPATH_TENANT: ${{ secrets.UIPATH_TENANT }}
run: uipath studio package analyze --output text
- name: Pack
working-directory: ./path/to/StudioProject
env:
UIPATH_PAT: ${{ secrets.UIPATH_PAT }}
UIPATH_ORGANIZATION: ${{ secrets.UIPATH_ORGANIZATION }}
UIPATH_TENANT: ${{ secrets.UIPATH_TENANT }}
run: uipath studio package pack --output ../../artifacts/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: uipath-package
path: artifacts/*.nupkg
deploy:
needs: build
runs-on: windows-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: uipath-package
- name: Publish (example)
run: |
echo "Add publish auth and folder options from uipathcli docs"
Azure DevOps Pipeline
trigger:
branches:
include:
- main
- develop
pool:
vmImage: 'windows-latest'
variables:
UIPATH_PAT: $(UiPathPAT)
stages:
- stage: Build
jobs:
- job: BuildPackage
steps:
- task: PowerShell@2
displayName: 'Install UiPath CLI'
inputs:
targetType: 'inline'
script: |
Invoke-WebRequest "https://github.com/UiPath/uipathcli/releases/latest/download/uipathcli-windows-amd64.zip" -OutFile "$(Agent.TempDirectory)\uipathcli.zip"
Expand-Archive -Force -Path "$(Agent.TempDirectory)\uipathcli.zip" -DestinationPath "$(Agent.TempDirectory)\uipathcli"
$env:PATH = "$(Agent.TempDirectory)\uipathcli;" + $env:PATH
- task: PowerShell@2
displayName: 'Analyze and pack Studio project'
inputs:
targetType: 'inline'
script: |
Set-Location "$(Build.SourcesDirectory)\path\to\StudioProject"
uipath studio package analyze --output text
uipath studio package pack --output "$(Build.ArtifactStagingDirectory)"
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'uipath-package'
- stage: Deploy
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: DeployToOrchestrator
environment: 'Production'
strategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
displayName: 'Publish (configure per uipathcli)'
inputs:
targetType: 'inline'
script: |
Write-Host "Wire authentication and target folder from uipathcli README"
Best Practices
Commit Message Convention
git commit -m "feat(invoice): Add OCR extraction for scanned invoices"
git commit -m "fix(selector): Update login button selector for new UI"
git commit -m "refactor(main): Split large workflow into sub-workflows"
git commit -m "docs(readme): Add setup instructions"
Branch Naming Convention
feature/JIRA-123-invoice-processing
bugfix/JIRA-456-selector-timeout
hotfix/JIRA-789-critical-login-fix
release/1.2.0
.gitignore for UiPath
# UiPath Project Files
.local/
.screenshots/
.objects/.local/
*.nupkg
# Build and Output
bin/
obj/
output/
TestResults/
# IDE and Editor
.vs/
*.user
*.suo
.idea/
# OS Generated
Thumbs.db
.DS_Store
desktop.ini
# Logs and Temp
*.log
logs/
*.tmp
*.temp
~$*
# Credentials and Secrets
.env
*.credentials
appsettings.*.json
!appsettings.json
# Package Manager
packages/
# Test Data (if sensitive)
TestData/sensitive/
Pre-Commit Checklist
git status
git diff
uipath studio package analyze --output text
uipath studio package pack --output ./artifacts/
git add .
git commit -m "Your descriptive message"
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|
| Large file error | XAML too big | Use Git LFS or split workflow |
| Merge conflicts in XAML | Concurrent edits | Use visual diff, coordinate with team |
| Authentication failed | Token expired | Re-authenticate with git credential-manager |
| Push rejected | Remote has changes | git pull --rebase then push |
| Detached HEAD | Checkout commit directly | git checkout main |
Resolve XAML Merge Conflicts
git mergetool
git checkout --ours Main.xaml
git checkout --theirs Main.xaml
git add Main.xaml
git commit -m "Resolve merge conflict in Main.xaml"
Undo Operations
git checkout -- Main.xaml
git reset HEAD Main.xaml
git reset --soft HEAD~1
git reset --hard HEAD~1
git revert abc1234
git push
Clean Up Repository
git clean -n
git clean -f
git clean -fd
git clean -fdx
Git Hooks for UiPath
Pre-Commit Hook
#!/bin/sh
echo "Running uipath studio package analyze..."
uipath studio package analyze --output text
if [ $? -ne 0 ]; then
echo "Analyze failed. Commit aborted."
exit 1
fi
echo "Analyze passed."
exit 0
Pre-Push Hook
#!/bin/sh
echo "Packaging UiPath project..."
uipath studio package pack --output ./.uipath-pack-tmp/
if [ $? -ne 0 ]; then
echo "Pack failed. Push aborted."
exit 1
fi
rm -rf ./.uipath-pack-tmp/
echo "Pack succeeded."
exit 0
Reference Documentation