{"id":23683862,"url":"https://github.com/ognisty321/gofile-cli","last_synced_at":"2026-05-09T15:04:13.183Z","repository":{"id":270156331,"uuid":"909489419","full_name":"Ognisty321/gofile-cli","owner":"Ognisty321","description":"A simple and flexible Bash CLI for interacting with the Gofile.io API","archived":false,"fork":false,"pushed_at":"2025-02-16T17:50:15.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T18:33:51.678Z","etag":null,"topics":["bash","cli","file-sharing","file-uploader","gofile","shell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ognisty321.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-28T21:20:47.000Z","updated_at":"2025-02-16T17:50:18.000Z","dependencies_parsed_at":"2024-12-29T01:16:18.978Z","dependency_job_id":null,"html_url":"https://github.com/Ognisty321/gofile-cli","commit_stats":null,"previous_names":["ognisty321/gofile-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ognisty321%2Fgofile-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ognisty321%2Fgofile-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ognisty321%2Fgofile-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ognisty321%2Fgofile-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ognisty321","download_url":"https://codeload.github.com/Ognisty321/gofile-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239735261,"owners_count":19688262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","file-sharing","file-uploader","gofile","shell"],"created_at":"2024-12-29T20:21:43.740Z","updated_at":"2026-05-09T15:04:13.151Z","avatar_url":"https://github.com/Ognisty321.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gofile CLI (Bash)\n\nA simple but robust Bash CLI (`gofile.sh`) for interacting with the Gofile.io API. Upload files (single or multiple), manage folders/contents, search, create direct links, and handle account actions, straight from your terminal.\n\n\u003e Uploads default to Gofile’s **global upload endpoint**, and the CLI can reuse the returned `folderId`/`guestToken` to keep multiple uploads in the same folder automatically.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n  - [Global Options](#global-options)\n  - [Commands](#commands)\n- [Examples](#examples)\n- [License](#license)\n\n---\n\n## Features\n\n- **Token management**\n  - Store your token in `~/.config/gofile-cli/config` (XDG-aware).\n  - Support for `--token` (per-command override) and `GOFILE_TOKEN` env var.\n  - `show-token` prints a **masked** token.\n\n- **Guest mode**\n  - Run commands without auth via `--guest` (useful for basic uploads / public operations).\n\n- **Smarter uploads**\n  - Uses Gofile’s **global upload endpoint** by default.\n  - Upload **multiple files** in one command; if you don’t pass `--folder`, the CLI reuses the folder returned by the first upload.\n  - Optional `--progress` for a progress bar.\n  - Optional server selection by `--zone eu|na` or `--server storeX` (legacy-style).\n\n- **More ergonomic commands**\n  - `ls` prints a human-friendly listing of a folder.\n  - Aliases: `servers`, `mkdir`, `rm`, `search`.\n\n- **Password hashing support**\n  - Some API endpoints accept/require a **SHA-256 hex password hash**; the CLI supports `--password` (hashes for you) and `--password-hash` (use your own).\n  - Helper command: `hash-password`.\n\n- **Direct links improvements**\n  - Create/update direct links with IP/domain allowlists, auth pairs, **and domainsBlocked**.\n\n- **Better output and error handling**\n  - Default pretty JSON output; switch to raw/compact when needed.\n  - Fails clearly on HTTP/API errors.\n\n---\n\n## Requirements\n\n1. **Bash** (Linux; macOS and WSL typically work too)\n2. **curl**\n3. **jq**\n4. For password hashing (one of):\n   - `sha256sum` (GNU), or `shasum` (macOS), or `openssl`\n\n---\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/Ognisty321/gofile-cli.git\n   cd gofile-cli\n   ```\n\n2. Make the script executable:\n\n   ```bash\n   chmod +x gofile.sh\n   ```\n\n3. (Optional) Put it on your PATH:\n\n   ```bash\n   sudo cp gofile.sh /usr/local/bin/gofile\n   # or:\n   # ln -s \"$PWD/gofile.sh\" /usr/local/bin/gofile\n   ```\n\nNow you can run `./gofile.sh` (or `gofile` if it’s in your PATH).\n\n---\n\n## Configuration\n\n### Set your token (recommended)\n\n```bash\n./gofile.sh set-token \u003cYOUR_API_TOKEN\u003e\n./gofile.sh show-token\n```\n\nConfig file location (XDG-aware):\n\n* Default: `~/.config/gofile-cli/config`\n\n### Alternative: environment variable\n\n```bash\nexport GOFILE_TOKEN=\"\u003cYOUR_API_TOKEN\u003e\"\n./gofile.sh get-account-id\n```\n\n### Alternative: per-command token override\n\n```bash\n./gofile.sh --token \"\u003cYOUR_API_TOKEN\u003e\" get-account-id\n```\n\n### Remove token from config\n\n```bash\n./gofile.sh unset-token\n```\n\n---\n\n## Usage\n\n```text\nUsage:\n  ./gofile.sh [global options] \u003ccommand\u003e [args...]\n```\n\n### Global Options\n\n* `--token \u003cTOKEN\u003e`: use TOKEN for this invocation (overrides config/env)\n* `--guest`: do NOT send Authorization header for this invocation\n* `-v, --verbose`: verbose output (repeat for more)\n* `--raw`: print raw JSON (no jq formatting)\n* `--compact`: print compact JSON (`jq -c`)\n* `-h, --help`: show help\n\n---\n\n## Commands\n\n### Token management\n\n* `set-token \u003cTOKEN\u003e`\n  Save token to config\n\n* `show-token`\n  Show token (masked)\n\n* `unset-token`\n  Remove token from config\n\n* `hash-password \u003cPASSWORD\u003e`\n  Print SHA-256 hex hash (useful for endpoints requiring password hashes)\n\n---\n\n### Servers\n\n* `get-servers [zone]` (alias: `servers`)\n  Get available servers. Optional zone: `eu` | `na`\n\n---\n\n### Upload\n\n* `upload \u003cfile...\u003e [--folder \u003cfolderIdOrUrl\u003e] [--zone eu|na] [--server storeX] [--url \u003cuploadUrl\u003e] [--progress] [--json]`\n\n  Notes:\n\n  * Uses the **global upload endpoint** by default.\n  * If `--folder` is omitted, the CLI reuses the folder returned by the first upload when uploading multiple files.\n\n* `upload-file \u003cfilePath\u003e [folderId] [zoneOrServer]`\n  Backwards-compatible wrapper for older usage (prefer `upload` going forward).\n\n---\n\n### Folders \u0026 contents\n\n* `create-folder \u003cparentFolderIdOrUrl\u003e [folderName] [--public true|false]` (alias: `mkdir`)\n* `ls \u003cfolderIdOrUrl\u003e [--json]`\n* `get-content \u003cfolderIdOrUrl\u003e [--password \u003cpw\u003e | --password-hash \u003csha256hex\u003e]`\n* `search-content \u003cfolderIdOrUrl\u003e \u003csearchString\u003e [--password \u003cpw\u003e | --password-hash \u003csha256hex\u003e]` (alias: `search`)\n* `update-content \u003ccontentIdOrUrl\u003e \u003cattribute\u003e \u003cnewValue\u003e`\n* `delete-content \u003ccontentIdsCsv\u003e` (alias: `rm`)\n* `copy-content \u003ccontentsIdCsv\u003e \u003cdestFolderIdOrUrl\u003e [--password \u003cpw\u003e | --password-hash \u003csha256hex\u003e]`\n* `move-content \u003ccontentsIdCsv\u003e \u003cdestFolderIdOrUrl\u003e [--password \u003cpw\u003e | --password-hash \u003csha256hex\u003e]`\n* `import-content \u003ccontentsIdCsv\u003e [--password \u003cpw\u003e | --password-hash \u003csha256hex\u003e]`\n\n\u003e Tip: For most commands you can pass either a **content ID** or a **share URL** like `https://gofile.io/d/AbCdEf`, the CLI extracts the ID automatically.\n\n---\n\n### Direct links\n\n* `create-direct-link \u003ccontentIdOrUrl\u003e [expireTime] [sourceIpsAllowedCsv] [domainsAllowedCsv] [authCsv] [domainsBlockedCsv]`\n* `update-direct-link \u003ccontentIdOrUrl\u003e \u003cdirectLinkId\u003e [expireTime] [sourceIpsAllowedCsv] [domainsAllowedCsv] [authCsv] [domainsBlockedCsv]`\n* `delete-direct-link \u003ccontentIdOrUrl\u003e \u003cdirectLinkId\u003e`\n\n---\n\n### Account\n\n* `get-account-id`\n* `get-account \u003caccountId\u003e`\n* `whoami`\n  Prints account id + root folder id (if available)\n* `reset-token \u003caccountId\u003e`\n  Invalidates your token and triggers a new one (sent via Gofile email)\n\n---\n\n## Examples\n\n### 1) Set token and check identity\n\n```bash\n./gofile.sh set-token abc123def456\n./gofile.sh show-token\n./gofile.sh whoami\n```\n\n### 2) Upload a single file (default global upload)\n\n```bash\n./gofile.sh upload \"/path/to/video.mp4\" --progress\n```\n\n### 3) Upload multiple files into the same folder automatically\n\n```bash\n./gofile.sh upload ./a.bin ./b.bin ./c.bin --progress\n```\n\n### 4) Upload to a specific folder\n\n```bash\n./gofile.sh upload \"./video.mp4\" --folder MyFolderId\n```\n\n### 5) Legacy-style server selection (optional)\n\n```bash\n./gofile.sh upload \"./video.mp4\" --zone eu\n# or:\n./gofile.sh upload \"./video.mp4\" --server store6\n```\n\n### 6) List a folder by URL\n\n```bash\n./gofile.sh ls https://gofile.io/d/AbCdEf\n```\n\n### 7) Search with spaces (URL-encoded safely)\n\n```bash\n./gofile.sh search-content MyFolderId \"music files\"\n```\n\n### 8) Password hashing helper + protected content access\n\n```bash\n./gofile.sh hash-password \"secret\"\n./gofile.sh get-content MyFolderId --password \"secret\"\n# or:\n./gofile.sh get-content MyFolderId --password-hash \u003csha256hex\u003e\n```\n\n### 9) Create a direct link with restrictions\n\n```bash\n./gofile.sh create-direct-link MyFileId 1704067200 \"192.168.1.10\" \"example.com\" \"alice:secret\" \"bad.com\"\n```\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fognisty321%2Fgofile-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fognisty321%2Fgofile-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fognisty321%2Fgofile-cli/lists"}