Go
Install CLI
Install the Elements CLI to your system. This will add the nve command to your path and provide several helpful commands for working with Elements.
curl -fsSL https://nvidia.github.io/elements/install.sh | bash
curl -fsSL https://nvidia.github.io/elements/install.cmd -o install.cmd && install.cmd && del install.cmd
# install the CLI
npm install -g @nvidia-elements/cli
Create a New Project
Use the Elements CLI to quickly bootstrap a new go project with the necessary dependencies:
nve project.create --type=go
Setup an Existing Project
Setup an existing project to use Elements you can use the setup command to add the necessary dependencies and configure the MCP server.
nve project.setup
If not yet done, install NodeJS. NodeJS is a JavaScript runtime that has a large ecosystem of tooling and packages for Web Development. Once installed the Node Package Manager (NPM) will be available for use.
Manual Integration
If installing to an existing project, install the core dependencies:
# install core dependencies
npm install @nvidia-elements/themes @nvidia-elements/styles @nvidia-elements/core
Elements is agnostic to any frontend or backend tooling. To leverage elements in Go based templating two paths are available.
- Static bundles with little to no JavScript ecosystem tooling
- Build time tooling with NodeJS and npm packages
The current simple Go starter provides an example of a basic Go web server leveraging the pre-built JS and CSS bundles. This enables Go generated HTML pages with minimal NodeJS/JavaScript ecosystem tooling.
But, if you would like to integrate advanced tooling such as TypeScript, treeshaking or other JavaScript ecosystem tools and packages consider leveraging tools like Vite and Vite Go
Registry Usage Guidelines
Security and Licensing Risks
When choosing between static bundles and build-time tooling with a package manager, it's important to consider security and legal compliance:
- Automated Vulnerability Scanning: NPM/PNPM and Artifactory provide built-in security scanning that detects known vulnerabilities in dependencies
- Dependency Auditing: Package managers track the complete dependency tree, making it easy to audit third-party libraries and identify versions used
- License Compliance: Automated license scanning helps compliance with legal requirements by flagging incompatible/restricted licenses
- Update Management: Centralized package management enables coordinated security updates, ensuring critical patches are applied consistently
- Version Control: Package lock files provide reproducible builds while keeping the actual library code out of source control
Committing Third-Party Libraries to Source Control Risks
- License Violations: Manual license tracking is error-prone and may result in using libraries with incompatible or restricted licenses, creating legal liability
- Hidden Vulnerabilities: Without automated scanning, security vulnerabilities in committed libraries may go undetected until they're exploited
- Stale Dependencies: Committed libraries are often not updated regularly, leaving projects exposed to known security issues
- Audit Complexity: Determining which third-party code is present, what versions are in use, and their license terms becomes a manual, time-consuming process
- Repository Bloat: Large binary files and library code increase repository size and slow down clone operations