https://github.com/rclone/rclone-openapi
OpenAPI 3.1 specification for the Rclone RC API
https://github.com/rclone/rclone-openapi
backblaze-b2 cloudinary cyberduck dropbox filezilla ftp fuse google-cloud-storage google-drive icloud internxt koofr openapi proton rclone rclone-browser rclone-gui rsync s3 sftp
Last synced: about 10 hours ago
JSON representation
OpenAPI 3.1 specification for the Rclone RC API
- Host: GitHub
- URL: https://github.com/rclone/rclone-openapi
- Owner: rclone
- License: mit
- Created: 2025-12-06T22:36:36.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-06-05T16:43:00.000Z (22 days ago)
- Last Synced: 2026-06-21T12:29:42.507Z (6 days ago)
- Topics: backblaze-b2, cloudinary, cyberduck, dropbox, filezilla, ftp, fuse, google-cloud-storage, google-drive, icloud, internxt, koofr, openapi, proton, rclone, rclone-browser, rclone-gui, rsync, s3, sftp
- Language: JavaScript
- Homepage:
- Size: 455 KB
- Stars: 41
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rclone OpenAPI
[](https://discord.gg/rclone)
[](https://www.npmjs.com/package/rclone-openapi)
[](https://www.npmjs.com/package/rclone-openapi)
[](LICENSE)
OpenAPI 3.1 specification for the [**Rclone RC API**](https://rclone.org/rc/).
## Installation
```bash
npm install rclone-openapi
```
## Usage
### Import the OpenAPI Schema
```javascript
// ESM
import schema from 'rclone-openapi';
// CommonJS
const schema = require('rclone-openapi');
```
Or import directly:
```javascript
import schema from 'rclone-openapi/openapi.json';
```
The YAML version is also available at **`openapi.yaml`**.
### TypeScript Types
This package includes auto-generated TypeScript types for the Rclone RC API:
```typescript
import type { paths, operations, components } from 'rclone-openapi';
// Example: Type for the /config/listremotes response
type ListRemotesResponse = paths['/config/listremotes']['post']['responses']['200']['content']['application/json'];
// Example: Type for operations
type CopyFileParams = operations['operationsCopyfile']['parameters']['query'];
// Example: Async operations return 202 with a job ID
type AsyncJob = components['responses']['AsyncJobResponse']['content']['application/json'];
```
Works great with API clients like [**openapi-fetch**](https://openapi-ts.dev/openapi-fetch/):
```typescript
import createClient from 'openapi-fetch';
import type { paths } from 'rclone-openapi';
const client = createClient({ baseUrl: 'http://localhost:5572' });
// Synchronous call
const { data, error } = await client.POST('/config/listremotes');
// Async call — returns 202 with { jobid }
const { data: job } = await client.POST('/sync/copy', {
body: { srcFs: 'drive:src', dstFs: 'drive:dst', _async: true },
headers: { Prefer: 'respond-async' },
});
```
## Files
| File | Description |
|------|-------------|
| **`openapi.json`** | OpenAPI 3.1 specification (JSON) |
| **`openapi.yaml`** | OpenAPI 3.1 specification (YAML) |
| **`types.d.ts`** | TypeScript type definitions |
## Development
Generate the JSON schema and TypeScript types from the YAML source:
```bash
npm run gen # Generate both JSON and types
npm run gen:json # Generate JSON only
npm run gen:types # Generate TypeScript types only
```
## Related
- [**Rclone SDK**](https://github.com/rclone-ui/rclone-sdk) — Ready-to-use client built on this spec (supports Rust and Javascript/Typescript)
- [**Rclone** RC API Documentation](https://rclone.org/rc/)
- [**Rclone**](https://rclone.org/) — Cloud storage sync tool
## License
MIT