Skip to content
Konstera
Capability catalogue
coderead

code.get_file

Read a file from a repository

Text content of one file. Large files are cut at the connection's max_file_bytes (truncated=true).

Effect
read
Fanout
no
Cache TTL
none
Traits
none
Implemented by

GitHub, Azure DevOps

The tenant picks one of these when they bind this capability at install time. New implementations land as connectors ship — browse the connector catalogue.

Request arguments

Passed as the args parameter to ctx.capability.call("code.get_file", …).

FieldTypeRequiredDescription
refstringnoBranch, tag or commit; default: the default branch
pathstringyes
repostringno

Response

Returned by ctx.capability.call("code.get_file", …).

FieldTypeRequiredDescription
refstring | nullno
urlstring | nullno
pathstringyes
repostringno
sizeintegerno
binarybooleanno
contentstring | nullnoUTF-8 text; null for binary files
truncatedbooleanno

Example call

From inside your agent's handle(). The kernel resolves code.get_file to the tenant's connector binding at invocation time.

response = await ctx.capability.call(
    "code.get_file",
    args={
        "ref": "...",
        "path": "...",
        "repo": "...",
    },
)

See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.