OUI MAC Address Lookup CLI

13.1.7 · active · verified Wed Apr 22

The `oui` package provides a command-line interface (CLI) tool for looking up vendor information associated with MAC addresses within the IEEE Organizationally Unique Identifier (OUI) database. As of version 13.1.7, this package is exclusively a CLI utility, meaning it does not expose any JavaScript or TypeScript APIs for programmatic usage. For developers requiring programmatic access to the OUI data or a library interface, the `oui-data` package is the designated alternative. The project maintains an active development status, with major versions often introducing breaking changes such as Node.js version requirements, removal of features like `search` and `update`, and changes in data sources. Its primary differentiator is its simplicity as a direct command-line lookup tool, relying on the official IEEE data source since version 12.0.0.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install and use the `oui` CLI via the command line and programmatically using `child_process` in Node.js, highlighting the CLI-only nature and suggesting `oui-data` for API usage.

// This package is CLI-only. For direct programmatic access to OUI data,
// consider using the 'oui-data' package (npm install oui-data).

// Example: Using the 'oui' CLI tool via Node.js child_process
const { exec } = require('child_process');

const macAddressToLookup = '20:37:06:12:34:56';

console.log(`Looking up vendor for MAC: ${macAddressToLookup}...\n`);

exec(`oui ${macAddressToLookup}`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error executing oui CLI: ${error.message}`);
    return;
  }
  if (stderr) {
    console.error(`CLI stderr: ${stderr}`);
  }
  console.log(`Vendor Information:\n${stdout.trim()}`);

  // Example of how you would use 'oui-data' if installed:
  /*
  import { lookupMacAddress } from 'oui-data';
  (async () => {
    try {
      const vendorInfo = await lookupMacAddress('20:37:06:12:34:56');
      console.log('\n(Programmatic lookup via oui-data):', vendorInfo);
    } catch (e) {
      console.error('Error looking up via oui-data:', e);
    }
  })();
  */
});

view raw JSON →