DorkOS
ApiFilesTree

List one level of a folder

GET
/api/files/tree

Preview. This operation may change in any release.

The entries of the folder at path under cwd (its top by default), depth levels deep. Dotfiles and entries .gitignore hides are left out unless showHidden is true.

Authorization

__Secure-better-auth.session_token<token>

The sign-in cookie a browser gets when a person signs in to DorkOS. An installed DorkOS on port 4242 names it __Secure-better-auth.session_token. On any other port the prefix carries a suffix for its data folder (better-auth-<hash>), and a development server leaves off __Secure-. From this computer, an operation that takes the sign-in cookie or a personal API key needs neither while "Ask for a password on this computer too" is off, which is how DorkOS installs (dorkos auth enable turns it on). A request from another device needs one, with one exception for now: a browser reaching a Docker container through its published port, while the container runs with DORKOS_ALLOW_INSECURE_BIND and has no owner account yet.

In: cookie

Query Parameters

cwd*string

The chat’s working folder.

Length1 <= length
path?string

The folder to list, relative to cwd; its top by default.

depth?integer

How many levels to list; 1 (the default) is the folder’s own entries.

Range1 <= value <= 8
showHidden?string

true also lists dotfiles and entries .gitignore hides.

Value in

  • "true"
  • "false"

Response Body

application/json

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/api/files/tree?cwd=string"
{  "entries": [    {      "name": "string",      "path": "string",      "type": "file",      "size": 0,      "mtime": 0,      "isSymlink": true    }  ]}