gitlab-file
GitLab repository file operations via API. ALWAYS use this skill when user wants to: (1) read file content from GitLab, (2) create/update/delete files via API, (3) get file blame info, (4) download raw files.
What this skill does
# File Skill Repository file operations for GitLab using `glab api` raw endpoint calls. ## Quick Reference | Operation | Command Pattern | Risk | |-----------|-----------------|:----:| | Get file info | `glab api projects/:id/repository/files/:path?ref=:branch` | - | | Get raw content | `glab api projects/:id/repository/files/:path/raw?ref=:branch` | - | | Get blame | `glab api projects/:id/repository/files/:path/blame?ref=:branch` | - | | Create file | `glab api projects/:id/repository/files/:path -X POST -f ...` | ⚠️ | | Update file | `glab api projects/:id/repository/files/:path -X PUT -f ...` | ⚠️ | | Delete file | `glab api projects/:id/repository/files/:path -X DELETE -f ...` | ⚠️⚠️ | **Risk Legend**: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger ## When to Use This Skill **ALWAYS use when:** - User wants to read file content from GitLab (not local) - User wants to create/update/delete files via GitLab API - User needs file blame information - User wants to download raw file content - User mentions "repository file", "blob", "raw content" **NEVER use when:** - User wants to edit local files (use file editing tools) - User wants to search code (use gitlab-search) - User wants to browse repository tree (use gitlab-repo) - User wants to commit multiple files (use git locally) ## API Prerequisites **Required Token Scopes:** `api` **Permissions:** - Read files: Reporter+ (for private repos) - Create/update/delete files: Developer+ (need push access) ## URL Encoding File paths must be URL-encoded. Slashes in paths become `%2F`: ```bash # src/main.py -> src%2Fmain.py echo 'src/main.py' | jq -Rr @uri # Output: src%2Fmain.py ``` ## Available Commands ### Get File Info (Base64 Encoded) ```bash # Get file metadata and content (base64) glab api "projects/123/repository/files/README.md?ref=main" --method GET # With URL-encoded path glab api "projects/123/repository/files/$(echo 'src/main.py' | jq -Rr @uri)?ref=main" # From specific branch glab api "projects/123/repository/files/config.json?ref=develop" --method GET # From tag glab api "projects/123/repository/files/version.txt?ref=v1.0.0" --method GET # From commit SHA glab api "projects/123/repository/files/app.py?ref=abc123" --method GET ``` **Response includes:** - `file_name` - File name - `file_path` - Full path - `size` - File size in bytes - `encoding` - Content encoding (base64) - `content` - Base64-encoded content - `content_sha256` - SHA256 hash - `ref` - Branch/tag/commit - `blob_id` - Blob SHA - `commit_id` - Last commit SHA - `last_commit_id` - Same as commit_id ### Decode Base64 Content ```bash # Get and decode file content glab api "projects/123/repository/files/README.md?ref=main" | \ jq -r '.content' | base64 -d ``` ### Get Raw File Content ```bash # Get raw file content (not base64) glab api "projects/123/repository/files/README.md/raw?ref=main" --method GET # With encoded path glab api "projects/123/repository/files/$(echo 'src/app.py' | jq -Rr @uri)/raw?ref=main" # Binary file (save to file) glab api "projects/123/repository/files/$(echo 'images/logo.png' | jq -Rr @uri)/raw?ref=main" > logo.png ``` ### Get File Blame ```bash # Get blame information glab api "projects/123/repository/files/$(echo 'src/main.py' | jq -Rr @uri)/blame?ref=main" --method GET # Parse blame output glab api "projects/123/repository/files/$(echo 'src/main.py' | jq -Rr @uri)/blame?ref=main" | \ jq -r '.[] | "\(.commit.author_name): lines \(.lines | length)"' ``` ### Create File ```bash # Create new file with content glab api "projects/123/repository/files/$(echo 'docs/new-file.md' | jq -Rr @uri)" --method POST \ -f branch="main" \ -f content="# New File\n\nContent here" \ -f commit_message="Add new documentation file" # Create with base64 content glab api "projects/123/repository/files/$(echo 'data/config.json' | jq -Rr @uri)" --method POST \ -f branch="main" \ -f content="$(cat config.json | base64)" \ -f encoding="base64" \ -f commit_message="Add configuration file" # Create on new branch glab api "projects/123/repository/files/$(echo 'feature/new.txt' | jq -Rr @uri)" --method POST \ -f branch="feature-branch" \ -f start_branch="main" \ -f content="Feature content" \ -f commit_message="Add feature file" # Create with author info glab api "projects/123/repository/files/script.sh" --method POST \ -f branch="main" \ -f content="#!/bin/bash\necho Hello" \ -f commit_message="Add script" \ -f author_email="[email protected]" \ -f author_name="Developer" ``` ### Update File ```bash # Update file content glab api "projects/123/repository/files/README.md" --method PUT \ -f branch="main" \ -f content="# Updated README\n\nNew content here" \ -f commit_message="Update README" # Update with base64 (for binary or complex files) glab api "projects/123/repository/files/$(echo 'config/settings.json' | jq -Rr @uri)" --method PUT \ -f branch="main" \ -f content="$(cat settings.json | base64)" \ -f encoding="base64" \ -f commit_message="Update settings" # Update on feature branch glab api "projects/123/repository/files/src%2Fapp.py" --method PUT \ -f branch="feature-update" \ -f content="$(cat app.py | base64)" \ -f encoding="base64" \ -f commit_message="Refactor app module" # Update with last known commit (for conflict detection) glab api "projects/123/repository/files/data.json" --method PUT \ -f branch="main" \ -f content="{ \"updated\": true }" \ -f commit_message="Update data" \ -f last_commit_id="abc123def456" ``` ### Delete File ```bash # Delete file glab api "projects/123/repository/files/$(echo 'old-file.txt' | jq -Rr @uri)" --method DELETE \ -f branch="main" \ -f commit_message="Remove deprecated file" # Delete with author info glab api "projects/123/repository/files/$(echo 'temp/test.txt' | jq -Rr @uri)" --method DELETE \ -f branch="main" \ -f commit_message="Clean up temp files" \ -f author_email="[email protected]" \ -f author_name="Developer" ``` ## File Operation Options | Option | Type | Description | |--------|------|-------------| | `branch` | string | Target branch (required for write ops) | | `start_branch` | string | Source branch for new files | | `content` | string | File content (plain text or base64) | | `encoding` | string | Content encoding: `text` (default) or `base64` | | `commit_message` | string | Commit message (required for write ops) | | `author_email` | string | Custom author email | | `author_name` | string | Custom author name | | `last_commit_id` | string | Expected last commit (for conflict detection) | ## Common Workflows ### Workflow 1: Download and View File ```bash # Get file content glab api "projects/123/repository/files/$(echo 'config/app.yml' | jq -Rr @uri)/raw?ref=main" ``` ### Workflow 2: Update Configuration File ```bash # 1. Download current file glab api "projects/123/repository/files/config.json/raw?ref=main" > config.json # 2. Edit locally # ... make changes to config.json ... # 3. Upload updated file glab api "projects/123/repository/files/config.json" --method PUT \ -f branch="main" \ -f content="$(cat config.json | base64)" \ -f encoding="base64" \ -f commit_message="Update configuration" ``` ### Workflow 3: Create File on Feature Branch ```bash # Create new file on new branch glab api "projects/123/repository/files/$(echo 'docs/feature.md' | jq -Rr @uri)" --method POST \ -f branch="feature-docs" \ -f start_branch="main" \ -f content="# Feature Documentation\n\nDetails here..." \ -f commit_message="Add feature documentation" ``` ### Workflow 4: Check File History via Blame ```bash # Get blame info for a file glab api "projects/123/repository/files/$(echo 'src/critical.py' | jq -Rr @uri)/blame?ref=main" | \ jq -r '.[] | "\(.commit.short_id) \(.commit.author_name): \(.lines | length) lines"' ``` ### Workflow 5: Batch Read Multiple Files ```bash # Read multiple files for file in "README.md" "package.json" "Dockerfile"; do e
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.