{"id":51866153,"url":"https://github.com/corca-ai/cf-vfs","last_synced_at":"2026-07-24T16:30:51.639Z","repository":{"id":372399068,"uuid":"1305718425","full_name":"corca-ai/cf-vfs","owner":"corca-ai","description":"Virtual file-system for Cloudflare Durable Objects and R2","archived":false,"fork":false,"pushed_at":"2026-07-21T01:21:11.000Z","size":321,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-21T01:26:52.588Z","etag":null,"topics":["cloudflare-workers","durable-objects","r2","sqlite","virtual-filesystem"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/corca-ai.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-07-19T13:09:43.000Z","updated_at":"2026-07-21T01:21:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/corca-ai/cf-vfs","commit_stats":null,"previous_names":["corca-ai/cf-vfs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/corca-ai/cf-vfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corca-ai%2Fcf-vfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corca-ai%2Fcf-vfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corca-ai%2Fcf-vfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corca-ai%2Fcf-vfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corca-ai","download_url":"https://codeload.github.com/corca-ai/cf-vfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corca-ai%2Fcf-vfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35848997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-24T02:00:07.870Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cloudflare-workers","durable-objects","r2","sqlite","virtual-filesystem"],"created_at":"2026-07-24T16:30:50.632Z","updated_at":"2026-07-24T16:30:51.633Z","avatar_url":"https://github.com/corca-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cf-vfs\n\n`cf-vfs` is a tree-shakable byte-oriented virtual filesystem and Bash-compatible\nruntime for Cloudflare Workers. The default shell API executes independent,\ncomplete source units; an optional `/shell/interactive` entry point preserves\nshell state between units. One SQLite-backed Durable Object owns a strongly\nconsistent pathname namespace. Files up to 8 MiB can be stored inline and read\nby shell utilities; large payloads live as immutable R2 objects and are\nintentionally opaque to the shell.\n\n```ts\nimport { DurableObject } from \"cloudflare:workers\";\nimport { Shell, type RemoteExecuteTextOptions } from \"@corca-ai/cf-vfs/shell\";\nimport { defaultShellCommands } from \"@corca-ai/cf-vfs/shell/commands/default\";\nimport { DurableObjectFileSystem } from \"@corca-ai/cf-vfs/storage/do-sql\";\nimport { R2OpaqueStore } from \"@corca-ai/cf-vfs/storage/r2\";\n\ninterface Env {\n  WORKSPACES: DurableObjectNamespace\u003cWorkspaceFiles\u003e;\n  FILE_BODIES: R2Bucket;\n}\n\nexport class WorkspaceFiles extends DurableObject\u003cEnv\u003e {\n  private readonly fileSystem: DurableObjectFileSystem;\n  private readonly shell: Shell;\n\n  constructor(ctx: DurableObjectState, env: Env) {\n    super(ctx, env);\n    this.fileSystem = new DurableObjectFileSystem(ctx.storage, {\n      opaqueStore: new R2OpaqueStore(env.FILE_BODIES),\n      workspaceId: ctx.id.toString(),\n    });\n    this.shell = new Shell({\n      fileSystem: this.fileSystem,\n      commands: defaultShellCommands,\n    });\n  }\n\n  executeText(options: RemoteExecuteTextOptions) {\n    return this.shell.executeText(options);\n  }\n\n  override async alarm() {\n    await this.fileSystem.drainGarbage();\n  }\n}\n\nexport async function execute(env: Env, workspaceId: string) {\n  const workspace = env.WORKSPACES.getByName(workspaceId);\n  return workspace.executeText({\n    script: `find src -name '*.ts' | sort \u003e files.txt`,\n    cwd: \"/workspace\",\n  });\n}\n```\n\n`WorkspaceFiles` extends only Cloudflare's required `DurableObject`; the cf-vfs\nparts are composed normally. `DurableObjectFileSystem` stores paths and inline\nbytes in `ctx.storage` (SQLite), while `R2OpaqueStore` connects the `FILE_BODIES`\nR2 binding for opaque-body verification and garbage collection. `WORKSPACES`\nroutes each workspace to its Durable Object. See [Getting\nstarted](docs/getting-started.md) for the Wrangler bindings, migration, and\ndirect-to-R2 upload path.\n\nFrom a repository checkout, run `npm run repl` for a local line-oriented\nsession backed by the in-memory VFS. `npm run repl:sqlite` runs the same\nterminal UI against a disposable SQLite-backed Durable Object in local\nworkerd.\n\nThis is an application runtime, not an operating-system shell or POSIX ABI. It\ndoes not launch processes, mount a host filesystem, or provide OS TTY/job\ncontrol. The supported language is an explicit versioned subset, and every\nparser, execution, stream, mutation, and storage boundary is bounded.\n\nThe pre-1.0 stream-first redesign is intentionally breaking. The old\n`{ command, input }` structured executor and text/binary storage split have\nbeen removed.\n\nRead [docs/index.md](docs/index.md) for setup, language and command semantics,\nthe SQLite/R2 lifecycle, limits, benchmarks, and compatibility details.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorca-ai%2Fcf-vfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorca-ai%2Fcf-vfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorca-ai%2Fcf-vfs/lists"}