Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

ContributingCommunityRepository

Get Started

InstallationGetting StartedCLI

Language

SyntaxTypesFunctionsStructsGenericsPattern MatchingError HandlingModulesTesting

Project

Code StyleContributing

Language

Modules

Tea uses `use alias = "module.path"` imports for stdlib modules and relative Tea files.

Modules let you split code across files and control which functions are part of the public API. In Tea, you import modules with use alias = "path" and call exported members through that alias.

Export from a local file

Mark exported definitions with pub. Anything without pub stays private to that module, which keeps internal helpers out of the external surface.

pub def triple(value: Int) -> Int
  return value * 3
end

def internal_label() -> String
  return "helpers"
end

Import it from another file

Relative imports point to nearby Tea files. Bind the import to an alias, then access exported members through that name.

use helpers = "./helpers"

@println(helpers.triple(5))

Stdlib imports

Checked-in examples use imports like use args = "std.args", use fs = "std.fs", and use regex = "std.regex". Each stdlib module exposes its public API from a mod.tea entrypoint.

Next steps

Continue to

std.args

See a real stdlib module reference page.

Continue to

Testing

Write test blocks that import your modules.