CLI

glyria generate

Regenerate auto-import type declarations.

Usage

npm run generate
# or
npx glyria generate

What it does

glyria generate scans your project and regenerates .glyria/imports.d.ts — the TypeScript declaration file that makes auto-imports work in your IDE.

It runs automatically on glyria init and glyria dev. You only need to run it manually in production after adding new utilities.

What gets scanned

Framework globals

All glyria.js utilities are declared globally automatically:

GlyriaClient, GlyriaCommand, GlyriaEvent, EmbedV2Builder,
GlyriaBus, createReplyableContext, defineGlyriaConfig, hexToNumber

discord.js globals

Common discord.js values and types are also available globally:

// values
GatewayIntentBits, Events

// types
GatewayIntentsString, BitFieldResolvable

User globals

glyria generate scans the following folders and files for exported functions, classes, and constants:

SourceDescription
src/utils/**Utility functions
src/composables/**Composables
src/index.tsRoot exports

Any export const, export function, or export class found in these files is added to the global scope automatically.

// src/utils/useDatabase.ts
export const useDatabase = () => { ... }
export const formatDate = (date: Date) => { ... }

After running glyria generate:

// src/commands/ping.ts — no import needed
const db = useDatabase()
const date = formatDate(new Date())

Output

The generated .glyria/imports.d.ts looks like this:

// auto-généré par glyria — ne pas modifier

export {}

declare global {
  const GlyriaClient: typeof import("@glyria/bot")["GlyriaClient"]
  const GlyriaCommand: typeof import("@glyria/bot")["GlyriaCommand"]
  const useDatabase: typeof import("../src/utils/useDatabase.ts")["useDatabase"]
  // ...
}

declare global {
  type GatewayIntentsString = import("discord.js").GatewayIntentsString
  type BitFieldResolvable = import("discord.js").BitFieldResolvable
}
This file is overwritten every time glyria generate runs. Any manual changes will be lost.

When to run manually

Run glyria generate when:

  • You add a new file to src/utils/ or src/composables/ in production
  • Your IDE doesn't recognize a global that should be available
  • After a glyria.js update that adds new globals

In dev mode, glyria dev handles this automatically.

Copyright © 2026