Beaker Docs
  • Welcome
  • Getting Started with Beaker
  • Joining the Social Network
  • Why use Beaker?
  • Beginner
    • Creating New Hyperdrives
    • Changing a Drive's Title or Thumbnail
    • Using the Editor
    • Detaching the Editor
    • Creating Files and Folders
    • Importing and Exporting Files
    • Sharing Hyperdrives
    • Hosting Hyperdrives
  • Intermediate
    • Your Profile Drive
    • Your Address Book
    • Your System Drive
  • Advanced
    • Webterm
    • Creating Mounts
    • Editing File Metadata
    • Forking Hyperdrives
    • Comparing and Merging Hyperdrives
  • APIs
    • beaker.capabilities
    • beaker.contacts
    • beaker.hyperdrive
    • beaker.markdown
    • beaker.peersockets
    • beaker.shell
    • beaker.terminal
  • Developers
    • Introduction to Hyperdrive
    • Index.json Manifest
    • Content-Type Negotiation
    • Frontends (.ui folder)
    • .Goto Files
  • Help
    • Hole-punchability
Powered by GitBook
On this page
  • beaker.terminal.registerCommand(command)
  • beaker.terminal.unregisterCommand(commandName)

Was this helpful?

  1. APIs

beaker.terminal

Previousbeaker.shellNextIntroduction to Hyperdrive

Last updated 5 years ago

Was this helpful?

beaker.terminal.registerCommand(command)

Register a Webterm Page Command. See the .

  • command Object

    • handle Function. The command's handling function. May be async. Accepts a single opts object as the first argument and then any number of positional arguments after.

    • name String. The name of the command.

    • help String. An optional help description of the command.

    • usage String. An optional usage description of the command.

  • Returns Void

beaker.terminal.registerCommand({
  name: 'alert',
  help: 'Display an alert box',
  usage: 'alert {message}',
  async handle (opts = {}, message = '') {
    alert(message)
  }
})
// @alert "Hello World"

beaker.terminal.unregisterCommand(commandName)

  • commandName String. The name of the command to unregister.

  • Returns Void.

beaker.terminal.unregisterCommand('alert')

Unregisters a Webterm Page Command. See the .

Webterm documentation on Page Commands
Webterm documentation on Page Commands